Posts

Showing posts with the label xslt

XSLT How to access attribute from different tag level?

Image
Clash Royale CLAN TAG #URR8PPP XSLT How to access attribute from different tag level? I am new to xsl & xslt. I am using xslt for xml to xml conversion. I have below xml file. I am iterating through REQ-IF/record using for-each loop and inside the loop I want to iterate REQ-IF/Attributes/Attribute to access @Name value. I tried using ../ but it only gives one level up values and do not allow me to iterate. Could you please help me with this? Thanks. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <REQ-IF> <record> <Name>ABC</Name> <Presentationname>Task Record</Presentationname> <GUID>123</GUID> </record> <record> <Name>DEF</Name> <Presentationname>Role Record</Presentationname> <GUID>456</GUID> </record> <record> <Name>GHI</Name> ...

Referencing an XML doctype entity from XSLT

Image
Clash Royale CLAN TAG #URR8PPP Referencing an XML doctype entity from XSLT I'm trying to access the !ENTITY elements in an XML file's !DOCTYPE declaration when using an XSL file to transform the XML to HTML. In the XML, I have a widget element that has an attribute that corresponds to the !ENTITY name, and I want the XSLT to transform that into the !ENTITY 's value. !ENTITY !DOCTYPE widget !ENTITY !ENTITY XML File <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE root[ <!ENTITY Widget_Manual "Widget_Manual_File_Name.pdf" > ]> <root> <!-- I want to convert this to "Widget_Manual_File_Name.pdf" in the transform --> <widget entityIdent="Widget_Manual" /> </root> XSLT File <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"...

How to I break an XML node into 2 using XSLT 1.0

Image
Clash Royale CLAN TAG #URR8PPP How to I break an XML node into 2 using XSLT 1.0 I have an XML node with a child element that I need to break up into two Something like this <node margin="5pt" color="red">with some text and <seperator/> where the element continues</node> The result should be <node margin="5pt" color="red">with some text and </node> <node margin="5pt" color="red">where the element continues</node> By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.