Thread: XSL Sort

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2011
    Posts
    1
    Rep Power
    0

    XSL Sort


    Hi All,

    I'm new to XSL and would like to use the sort facility for sorting the nodes of the below XSD.



    xml Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ProductServiceMessage>
        <Product>
            <ProductNumber></ProductNumber>
            <Descriptor>
                <DescriptorName></DescriptorName>
                <DescriptorValue></DescriptorValue>
            </Descriptor>
            <Descriptor>
                <DescriptorName></DescriptorName>
                <DescriptorValue></DescriptorValue>
            </Descriptor>
            <Characteristic>
                <CharacteristicType></CharacteristicType>
                <CharacteristicValue></CharacteristicValue>
            </Characteristic>
            <Characteristic>
                <CharacteristicType></CharacteristicType>
                <CharacteristicValue></CharacteristicValue>
            </Characteristic>
            <PSG>
                <PSGId></PSGId>
                <LPGId></LPGId>
                <LPGId></LPGId>
            </PSG>
            <PSG>
                <PSGId></PSGId>
                <LPGId></LPGId>
                <LPGId></LPGId>
            </PSG>
            <Incentive>
                <IncentiveDescription></IncentiveDescription>
                <IncentiveOfferNumber></IncentiveOfferNumber>
            </Incentive>
            <Incentive>
                <IncentiveDescription></IncentiveDescription>
                <IncentiveOfferNumber></IncentiveOfferNumber>
            </Incentive>
            <ProductOption>
                <ProductOptionNumber></ProductOptionNumber>
                <FeatureCode></FeatureCode>
                <SupplierImages mainView="false">
                    <SupplierImage></SupplierImage>
                    <ImageFilePath></ImageFilePath>
                    <ThumbImage></ThumbImage>
                    <FullSizeImage></FullSizeImage>
                    <HugeImage></HugeImage>
                    <ZoomifyImage></ZoomifyImage>
                </SupplierImages>
                <SupplierImages mainView="false">
                    <SupplierImage></SupplierImage>
                    <ImageFilePath></ImageFilePath>
                    <ThumbImage></ThumbImage>
                    <FullSizeImage></FullSizeImage>
                    <HugeImage></HugeImage>
                    <ZoomifyImage></ZoomifyImage>
                </SupplierImages>
            </ProductOption>
        <Product>
            <ProductNumber></ProductNumber>
            <Descriptor>
                <DescriptorName></DescriptorName>
                <DescriptorValue></DescriptorValue>
            </Descriptor>
            <Descriptor>
                <DescriptorName></DescriptorName>
                <DescriptorValue></DescriptorValue>
            </Descriptor>
            <Characteristic>
                <CharacteristicType></CharacteristicType>
                <CharacteristicValue></CharacteristicValue>
            </Characteristic>
            <Characteristic>
                <CharacteristicType></CharacteristicType>
                <CharacteristicValue></CharacteristicValue>
            </Characteristic>
            <PSG>
                <PSGId></PSGId>
                <LPGId></LPGId>
                <LPGId></LPGId>
            </PSG>
            <PSG>
                <PSGId></PSGId>
                <LPGId></LPGId>
                <LPGId></LPGId>
            </PSG>
            <Incentive>
                <IncentiveDescription></IncentiveDescription>
                <IncentiveOfferNumber></IncentiveOfferNumber>
            </Incentive>
            <Incentive>
                <IncentiveDescription></IncentiveDescription>
                <IncentiveOfferNumber></IncentiveOfferNumber>
            </Incentive>
            <ProductOption>
                <ProductOptionNumber></ProductOptionNumber>
                <FeatureCode></FeatureCode>
                <SupplierImages mainView="false">
                    <SupplierImage></SupplierImage>
                    <ImageFilePath></ImageFilePath>
                    <ThumbImage></ThumbImage>
                    <FullSizeImage></FullSizeImage>
                    <HugeImage></HugeImage>
                    <ZoomifyImage></ZoomifyImage>
                </SupplierImages>
                <SupplierImages mainView="false">
                    <SupplierImage></SupplierImage>
                    <ImageFilePath></ImageFilePath>
                    <ThumbImage></ThumbImage>
                    <FullSizeImage></FullSizeImage>
                    <HugeImage></HugeImage>
                    <ZoomifyImage></ZoomifyImage>
                </SupplierImages>
            </ProductOption>        
        </Product>
    </ProductServiceMessage>

    [[ use &amp;#91;highlight=xml] tags when posting XML --requinix ]]





    Now i would like to SORT on ProductOptionNumber , Characteristic , LPGId , Incentive , SupplierImages nodes.

    I would like to Pass the Node name for which i would wish to Sort the node from the Java Program to the XSL. I know how to set the Node name from the Java Program,but getting stuck in creating an XSL for the program.

    Please could anyone help me on the same. ( also need to consider the namespaces as well , if possible )

    Regards,
    Vidya.
    Last edited by requinix; June 30th, 2011 at 01:38 PM.
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,191
    Rep Power
    9398

IMN logo majestic logo threadwatch logo seochat tools logo