xsl-list
[Top] [All Lists]

[xsl] FW: XSLT newbie

2006-12-26 15:18:30
Hi,

I am trying to achieve the following using XSLT :

I apply a XSLT on my source XML to get a path - say, books/author/name

Now, I want to see if this node exists in another xml. Is there a way by
which this can be achieved using XSLT ?


Sample Source XML : The dots are used as delimiters and will later be
replaced to slashes in the XSLT.

Paths.xml

<Paths>
        <path1>books.book.author.name</path1>
        <path2>books.book.name</path2>
</Paths>

------------------------------------------------------------------------
-------------

Sample Input XML.

Input.xml

<books>
        <book>
                <name>a1</book>
                <price>10</price>
                <author>
                        <name>b1</name>
                        <gender>m</gender>
                </author>
        </book>
        <book>
                <name>a2</book>
                <price>10</price>
                <author>
                        <name>b2</name>
                        <gender>f</gender>
                </author>
        </book>
</books>


The XSLT should first get the path from the paths.xml and search the
Input.xml to see if the node specified by the path exists. Can somebody
please let me know how to go about solving this.

Regards,
BT


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is 
available at http://www.merck.com/contact/contacts.html) that may be 
confidential, proprietary copyrighted and/or legally privileged. It is 
intended solely for the use of the individual or entity named on this 
message. If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then 
delete it from your system.

------------------------------------------------------------------------------

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>