| | |
Convert XML file to another XML file using XSLT
Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
I need to convert the following XML file
to
I am able to get the styles tags but how Can I get the Texts tags with style-names as P1 and P2
Thank you in advance
xml Syntax (Toggle Plain Text)
<Para> <PgfTag value="Body" type="str"/> <Pgf> <PgfFont> <FFamily value="Times New Roman" type="str"/> <FWeight value="Regular" type="str"/> </PgfFont> </Pgf> <ParaLine> <String>Underlined charcter</String> </ParaLine> </Para> <Para> <PgfTag value="Body" type="str"/> <Pgf> <PgfFont> <FFamily value="Times New Roman" type="str"/> <FWeight value="Regular" type="str"/> <FAngle value="Italic" type="str"/> </PgfFont> </Pgf> <ParaLine> <String>Italic charcter</String> </ParaLine> </Para>
to
XML, XSLT and XPATH Syntax (Toggle Plain Text)
<styles> <style family="paragraph" name="P1"> <paragraph-properties line-height-at-least="0.1945in" text- autospace="none" /> <text-properties text-underline-style="solid" text-underline-width="auto"/> </style> <style family="paragraph" name="P2"> <paragraph-properties line-height-at-least="0.1945in" text-autospace="none"> </paragraph-properties> <text-properties font-style="italic"> </text-properties> </style> </styles> <body> <texts> <text style-name="P1"> Underlined charcter </text> <text style-name="P2"> Italic charcter </text> </texts> </body>
I am able to get the styles tags but how Can I get the Texts tags with style-names as P1 and P2
Thank you in advance
Last edited by peter_budo; 23 Days Ago at 4:03 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
•
•
Join Date: Nov 2009
Posts: 2
Reputation:
Solved Threads: 0
I need to convert the following XML
to XML
There can be multiple Para in the input XML. so there will be multiple style as P1 , P2, P3 , T1, T2 etc
Thank you for your reply
xml Syntax (Toggle Plain Text)
<Para> <Unique value="998197" type="enum" /> <PgfTag value="Body" type="str" /> <Pgf> <PgfFont> <FFamily value="Times New Roman" type="str" /> </PgfFont> </Pgf> <ParaLine> <TextRectID value="19" type="enum" /> <String>Sushil Font Time Roman </String> <Font> <FFamily value="Garamond" type="str" /> </Font> <String>Sharma Font Garamond</String> </ParaLine> </Para>
to XML
XML, XSLT and XPATH Syntax (Toggle Plain Text)
<automatic-styles> <style name="P1" family="paragraph"> <text-properties font-style="Regular" font-size="10.0" font-name="Times New Roman" /> </style> <style name="T1" family="text"> <text-properties font-name="Garamond" /> </style> </automatic-styles> <texts> <text style-name="P1"> Sushil Font Time Roman <span style-name="T1"> Sharma Font Garamond </span> </text> </texts>
There can be multiple Para in the input XML. so there will be multiple style as P1 , P2, P3 , T1, T2 etc
Thank you for your reply
Last edited by peter_budo; 23 Days Ago at 4:03 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
0
#3 23 Days Ago
sushil.sharma75,
XSLT is a language for converting XML documents into other documents. Because XSLT is itself an XML vocabulary, it is possible to generate XSLT stylesheets as the output of a transformation, but it's unusual and not for beginners. What do you actually want to achieve?
XSLT is a language for converting XML documents into other documents. Because XSLT is itself an XML vocabulary, it is possible to generate XSLT stylesheets as the output of a transformation, but it's unusual and not for beginners. What do you actually want to achieve?
Failure is not fatal, but failure to change might be. - John Wooden
![]() |
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: Get all <img> Tags that are siblings?
- Next Thread: XPath Expression to calculate total amount for order details
| Thread Tools | Search this Thread |
api blogger blogging code delete development dynamiccreationofnvariablesinxslt error firstthreecharacterofastringrequired flipbook gdata google html include java link linspire linux microsoft news node openoffice overwrite precedence programming rss standards swf template transform variable w3c web xml xmlnotloading xmlonserver xsl xslt






