Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: ok, must be doing something stupid but HELP (XSL problem)

From: Martin Honnen <mahotrash@-----.-->
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent