Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Newbie to XML & XSL - problems selecting element values in XSL >Thread Next - Re: Newbie to XML & XSL - problems selecting element values in XSL Re: Newbie to XML & XSL - problems selecting element values in XSLTo: NULL Date: 11/6/2007 10:14:00 AM Thanks for the reply, I will create all new files in the same directory (paste the same XMLcode in) and give it a try. Rob "Joe Fawcett" <joefawcett@n...> wrote in message news:eOGDySFIIHA.5684@T...... > "Rob W" <Whllrob@a...> wrote in message > news:uwp1v4$HIHA.1184@T...... >> Greetings, >> >> Im having alot of difficulties trying to select the value of an element >> from my XML file to XSL file. >> >> Im trying to select the value of element <DeliveryNoteNo> into my XSL >> file output, Xpath matches the path but does not select the value of >> <DeliveryNoteNo> i.e it prints from the line <strong>Deliver Note No: >> </strong> but cannot select the value of my:DeliveryNoteNo. >> >> Does anybody have any ideas? >> Perhaps I need to look back at my schema too? >> >> See xml and xsl files below. >> >> Xml file extract. >> <?xml version="1.0" encoding="UTF-8"?> >> <!-- edited with XMLSpy v2007 (http://www.altova.com) by Rob >> (EMBRACE) --> >> <PODBatch xmlns="http://my-pod/namespace" >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >> xsi:schemaLocation="http://my-pod/namespace >> E:\DOCUME~1\Rob\Desktop\POD02.XSD"> >> <POD> >> <DeliveryInfo> >> <DeliveryNoteNo>DN012345</DeliveryNoteNo> >> <DeliveryDateTime>01/11/07 10:35</DeliveryDateTime> >> <DeliveryDrivername>Bill Egg</DeliveryDrivername> >> <DeliveryDriverSignature>B.Egg</DeliveryDriverSignature> >> <DeliveryStatus>In transit</DeliveryStatus> >> </DeliveryInfo> >> </POD> >> </PODBatch> >> >> >> Here is my full XSL file:- >> >> <?xml version="1.0" encoding="UTF-8"?> >> <xsl:stylesheet version="2.0" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >> xmlns:xsi ="http://www.w3.org/2000/10/XMLSchema-instance" >> xmlns:my="http://my-pod/namespace"> >> <xsl:template match="/"> >> <html> >> <Header> >> <img >> src="http://i140.photobucket.com/albums/r13/robtyketto/truck-clipart-icon2_ys61.gif" >> align="left"/> >> <h2>Proof-of-Delivery</h2> >> <xsl:apply-templates select="//my:POD/my:DeliveryInfo"/> >> <br></br> >> <hr></hr> >> </Header> >> <body> >> <h3>Sender:</h3> >> <address> >> Company<br /> >> </address> >> </body> >> </html> >> </xsl:template> >> <xsl:template match="my:POD/my:DeliveryInfo"> >> <strong>Deliver Note No: </strong> >> <xsl:value-of select="my:DeliveryNoteNo"/> >> </xsl:template> >> </xsl:stylesheet> >> >> Thanks >> Rob W >> > Can't see anything obviously wrong and works for me using > XslCompiledTransform in .NET and Saxon 8.9. > > > -- > > Joe Fawcett (MVP - XML) > http://joe.fawcett.name > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
