XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Michael KweeSubject: Calling 2 XSLT from the main XSLT
Author: Michael Kwee
Date: 20 Dec 2006 01:15 AM
Originally Posted: 20 Dec 2006 01:10 AM
Hi there,

We have a main XSLT that calls 2 XSLT. The first XSLT is to map the elements/attributes in the "source" XML to the "target" XML. The second XSLT is to translate elements/attributes starting with "LOV_" in the "target" XML to other values by looking up the corresponding values in a "reference" XML.

The resulting XML should have the attributes LOV_Back_Office_Region__IntObjectFormat converted from "US_AR" to "AR" and LOV_Back_Office_Region__IntObjectName from "US_CO" to "CO".

We use "template match" to do this but it was not matching the nodes starting with "LOV_".

Please advise how can we match the "LOV_" in the second XSLT.

Please see attached :

Source XML : test_a1.xml

Target XSD : dest1.xsd

Main XSLT : test_main_1.xsl

First XSLT : INT.xsl

Second XSLT : test_lov9.xsl

Reference XML : eai_value_map.xml

Thanks,
Michael Kwee


Unknowntest_a1(1).xml


Unknowndest1.xsd


Unknowneai_value_map(1).xml


Unknowntest_main_1.xsl


UnknownINT.xsl


Unknowntest_lov9.xsl

Postnext
James DurningSubject: Calling 2 XSLT from the main XSLT
Author: James Durning
Date: 20 Dec 2006 02:19 PM
Have you tried
<xsl:template match="*[starts-with(name(),'LOV_')]">

Postnext
Michael KweeSubject: Calling 2 XSLT from the main XSLT
Author: Michael Kwee
Date: 20 Dec 2006 05:22 PM
Yes, i have tried template match *[starts-with(name(),'LOV_')] but it is still not matching those elements that start with 'LOV_'.

I set the debugging on. When it reaches the step "<xsl:template name="lov_lookup" match="*[starts-with(name(),'LOV_')]">" in test_lov9.xls, it shows that name() contains a value of "#document".

Not sure what does this mean but i am sure it's not getting the output of INT.xls and parse it in test_lov9.xls.

Please advise further. Thanks.

Michael

Posttop
Minollo I.Subject: Calling 2 XSLT from the main XSLT
Author: Minollo I.
Date: 20 Dec 2006 05:35 PM
If you keep your call unchanged in the root template to:
<xsl:call-template name="lov_lookup"/>

...you are going to explicitly execute the lov_lookup template just when the context is the root document (that's what you see in name()). You should change that to something like:
<xsl:apply-templates/>

...to give a chanve to the XSLT engine to actually match templates against the elements in the source document.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.