[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Writing a stylesheet to create another XML Document
Hi! I am trying to combine two XML Documents: Tutorial.xml, and Author.xml using the stylesheet TutorialWithAuthorName.xsl For starters, I don't even know if my stylesheet will work to include the Author.xml/AuthorList/Author/Name. Once I get that sorted, I was wondering if an XML file could be generated to include the Author.xml/AuthorList/Author/Name ? Also, will this XML file be "live". I.E. will it change each time the Author.xml has been changed ? TIA, Kunal The contents of each of the files are: Tutorial.xml ************ <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href=" TutorialWithAuthorName.xsl" ?> <Tutorial> <AuthorList> <Author id="1" /> <Author id="2" /> <Author id="3" /> <Author id="4" /> </AuthorList> </Tutorial> ************ Author.xml ********** <?xml version="1.0"?> <AuthorList> <Author id="1"> <Name>Ms. A B C</Name> </Author> <Author id="2"> <Name>Ms. D E F</Name> </Author> <Author id="3"> <Name>Ms. G H I</Name> </Author> <Author id="4"> <Name>Ms. J K L</Name> </Author> </AuthorList> ********** TutorialWithAuthorName.xsl ************************** <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:apply-templates select="document(Author.xml)/AuthorList/Author[@id='1']" /> </xsl:template> <xsl:template match="/AuthorList/Author"> Author Name <xsl:value-of select="Name" /> </xsl:template> </xsl:stylesheet> ************************** XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|