Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - ok, must be doing something stupid but HELP (XSL problem) >Thread Next - Re: ok, must be doing something stupid but HELP (XSL problem) Re: ok, must be doing something stupid but HELP (XSL problem)To: NULL Date: 3/12/2009 5:24:00 PM Gina_Marano wrote: > XSL: > > <?xml version="1.0"?> > <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ > Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" > xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1"> > <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/ > <xsl:template match="/"> > <Order xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <xsl:attribute name="orderDate"><xsl:value-of select="/PrintTalk/ > @timeStamp"/></xsl:attribute> > <PrintTalk xmlns="http://www.printtalk.org/schema" xmlns:jdf="http:// > www.CIP4.org/JDFSchema_1_1" xmlns:xsi="http://www.w3.org/2001/ > XMLSchema-instance" payloadID="2008-02-21T11:08:25-08:00.XYZ- > STR-350047@x..." timeStamp="2008-02-21T11:08:25-08:00" > version="1.1" xsi:schemaLocation="http://www.printtalk.org/schema > http://www.printtalk.org/schema/printTalk_1_1.xsd"> Due to xmlns="http://www.printtalk.org/schema" the 'PrintTalk' element and its descendant elements are in the namespace http://www.printtalk.org/schema so for XSLT 1.0 to select or match elements in that namespace your stylesheet needs to bind a prefix to that namespace URI and use that prefix in XPath expressions and match patterns to qualify element names: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:pt="http://www.printtalk.org/schema" exclude-result-prefixes="pt"> <xsl:template match="/"> <Order orderDate="{pt:PrintTalk/@timeStamp}"> ... </Order> </xsl:template> Apply the same change to all your XPath expressions. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
