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
Rohit KSubject: XML processing
Author: Rohit K
Date: 12 Jul 2007 12:56 PM
Hi
I have already posted a problem titled "XSL Pre processing" in this forum but have not received any replies. Just wanted to re iterate the problem statement:
Normally we have an XML (say in.xml) and then we apply XSL on it and transform it to say out.xml.
What I need is that before applying the XSL, I want to make some modifications in in.xml and that modification is dependent on some business rule (Like if value of so and so tag is X, change it to y etc).
So instead of applying my XSL on in.xml, I need to apply it on in1.xml (Which is the XML I would get after modifying my in.xml). Question is where and how should I write the logic for transforming my in.xml to in1.xml. Should this be written in the same XSL? If yes then how? I do not want to change any tag of my main input XML neither the tags are fixed. Only values of few tags needs to be modified and rest of the in.xml should remain as it is.

Eg: if my in.xml is
<address>
<name>
<first>Rohit</first>
<last>K</last>
</name>
<id>rohit1183</id>
</address>

Suppose my requirement is that if last name is K, change it to L.

My in1.xml should be
<address>
<name>
<first>Rohit</first>
<last>L</last>
</name>
<id>rohit1183</id>
</address>

Rest of the XML should be as it is. Now my XSL should be applied to the new XML (in1).

Postnext
Jamil TaylorSubject: XML processing
Author: Jamil Taylor
Date: 12 Jul 2007 03:07 PM
I would write a program that contains the business rules of how to change the xml data. Execute this program prior to applying the XSL transformation.

You have tons of options, and this is not really an XSLT type quesion(which may be why you did not receive replies).

Posttop
Rohit KSubject: XML processing
Author: Rohit K
Date: 12 Jul 2007 03:23 PM
But this has to be done in XSL...infact the same XSL that would be applied on the input.

 
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.