I have a question from my course.. figure I'd ask you guys.
from the following code:
and if the following code is sample.xslCode:<?xml version="1.0" ?> <?xml-stylesheet type='text/xsl' href='sample.xsl'?> <Books> <ItemInformation> <ISBN>0131453491</ISBN> <PersonalAuthor>Megginson, David 1964</PersonalAuthor> <Title>Imperfect XML</Title> <Edition>3</Edition> <PublicationInformation> Upper Saddle River </PublicationInformation> <PhysicalDescription>xviii, 229 p. : ill. ; 24 cm.</PhysicalDescription> <GeneralNote>Sample</GeneralNote> <SubjectTerm>Sample</SubjectTerm> <Copy> <Record id="1"> <Library>UOIT</Library> <CallNumber>QA76.76.H94 M4392005</CallNumber> <Copy>1</Copy> <Material>Book-UOIT</Material> <Location>On the shelf -3rd Floor</Location> <DueDate>02-28-2006</DueDate> <Note>Sample</Note> </Record> </Copy> </ItemInformation> </Books>
Why does the answer turn out to be:Code:<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="Books"> <html> <body> <h1><xsl:value-of select="ItemInformation/Copy/../Edition/.."/></h1> </body> </html> </xsl:template> <xsl:template match="text()"/> </xsl:stylesheet>
0131453491 Megginson, David 1964 Imperfect XML 3 Upper Saddle River xviii, 229 p. : ill. ; 24 cm. Sample Sample UOIT QA76.76.H94 M4392005 1 Book-UOIT On the shelf -3rd Floor 02-28-2006 Sample
The problem I'm having is from "ItemInformation/Copy/../Edition/.."
why would this code mean the whole thing?


LinkBack URL
About LinkBacks
Reply With Quote




