on 12-28-2005 5:34 AM
Hi,
I have a scenario where I need to perform an XML to XML transformation and I need to do this using XSLT mapping.
I am using XMLSpy.
Could somebody help me on this issue?Any weblogs that can help me on this?
regards,
Prashanth
hi Prashanth
for XSLT mapping u have to use mapforce a tool
available with xmlspy
u can a 30 days trial from altova.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi prashanth,
In your Altova XMLSpy, after u've typed your XSL program which will be performing the XSLT mapping, just select the Menu --> XSL/XQuery, and then --> XSDTransformation (f10 will also do..!!). It will ask u to give the path for your source XML file and generate the output structure on the basis of the code u've typed.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Divya,
I do not want to get into XI to solve this problem. I have shown the source and target XML in my previous post.
Is there a way I can write the xslt in XMLSpy without using XI?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prashanth,
You can do the xsl transformation in XMLSpy itself.First create your source xml file in XMLSpy by selecting file type as xml.After that create your xslt program file by selecting file type as xslt.
Then you can use the xslt program for transformation of source xml into target xml by choosing menu XSL/XQuery->XSL Transformation.
sample xsl code for an example:
source xml structure:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<header>
<detail>
Detail1
</detail>
<detail>
Detail2
</detail>
</header>
<header>
<detail>
Detail3
</detail>
</header>
</root>
-
xsl program:
<xsl:stylesheet version = '1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">
<root>
<xsl:for-each select="//header">
<idoc>
<xsl:for-each select="detail">
<detail>
<xsl:value-of select="."/>
</detail>
</xsl:for-each>
</idoc>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>
-
target xml structure:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<idoc>
<detail>
Detail1
</detail>
<detail>
Detail2
</detail>
</idoc>
<idoc>
<detail>
Detail3
</detail>
</idoc>
</root>
Hope this would help.
Rgds
Sudhakar.
Hi Shailesh,
See..just imagine that I do not have access to XI. I have only the source and target XML and the XMLspy. How do I go about impementing the mapping in XSLT?
cheers,
Prashanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sailesh,
Consider that I do not have the xsd, but only the XML structure. It is like this..
Src: <root>
<header> (1 to n occurances)
<detail>(1 to n occurances)
</detail>
</header>
Tgt: <root>
<idoc> (1 to n occurances)
<detail>(1 to n occurances)
</detail>
</idoc>
It is a multiple mapping scenario and I have to use only XSL mapping.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi prashanth
u have the XML structure for both Source and Target as well right.
Create <b>Data types</b> and <b>Message types</b> for both these structures within XI.
Now when u create the message type, u click on the TAB named <b>XSD</b>. Xsd will be generated for the Message type by XI itself.
Copy it and save it in a notepad with extension<b> .xsd</b>.
import this file in XMLspy and do the mapping..
Cheers:)
Shailesh
Hi Prashanth
what u have to do is.
1) Take the xsd of ur Message types from Xi (both source and target).
2) load the same in XMLspy
3) Perform the mapping. Save the mapping program as <b>.xsl</b> extension.
4) Zip it and import it into <b>Imported archives</b> within XI.
5) while creating Interface mapping u can specify this as ur mapping program.
Cheers:)
Shailesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.