Tag xslt

[Solved] template condition is not matching [closed]

See , it says about the contains function: “If the value of $arg2 is the zero-length string, then the function returns true.”. You could however check <xsl:when test=”contains(.”) and not(matches(substring-before(.”),’ ‘)) and not(./@align)”> 3 solved template condition is not matching…

[Solved] XML XSLT transformation

**<?xml version=”1.0″ encoding=”UTF-8″?> <xsl:stylesheet version=”1.0″ xmlns:xsl=””> <xsl:template match=””> <xsl:element name=”document”> <xsl:apply-templates select=”bill”/> </xsl:element> </xsl:template> <xsl:template match=”//docTitle”> <para format=”6655″ loc=”05″> <xsl:apply-templates/> </para> </xsl:template> <xsl:template match=”//officialTitle”> <para format=”66554″ loc=”11″> <xsl:apply-templates/> </para> </xsl:template> <xsl:template match=”//enactingFormula”> <para format=”6501″ loc=”20″> <xsl:apply-templates/> </para> </xsl:template> <xsl:template match=”//section”>…

[Solved] Separate duplicates from unique

If I understand correctly your explanation, you want to do something like: XSL 1.0 <xsl:stylesheet version=”1.0″ xmlns:xsl=””> <xsl:output method=”xml” version=”1.0″ encoding=”UTF-8″ indent=”yes”/> <xsl:key name=”cust-by-charge” match=”Customer” use=”chargeto” /> <xsl:template match=”/CustomerRecord”> <Root> <Customer_PO> <xsl:copy-of select=”Customer[count(key(‘cust-by-charge’, chargeto)) > 1]”/> </Customer_PO> <Customer_Falty> <xsl:copy-of select=”Customer[count(key(‘cust-by-charge’,…

[Solved] I need to add a text value to an self closing empty tag, using XSLT

You need an identity transformation template: <xsl:template match=”@*|node()”> <xsl:copy> <xsl:apply-templates select=”@*|node()”/> </xsl:copy> </xsl:template> plus a template for the name tag: <xsl:template match=”name[not(node())]”> <name>UNK</name> </xsl:template> Wrap this within the stylesheet tag, and add an xml header: <?xml version=”1.0″ encoding=”ISO-8859-1″?> <xsl:stylesheet version=”1.0″…

[Solved] Create a dynamic XSL and generate html

I don’t think you need grouping for your Alert issues. It looks like you simply want to output Alert issues which are referenced by “Item/Issue” records. So, what you can do, is define a key like to look up “Item/Issue”…

[Solved] XLST – Copy XML tag and replace attribute value [closed]

XSLT based solution. Input XML <config> <connection port=”4404″ type=”tcp”> <selection name=”test-mode” enabled=”true”/> </connection> <connection port=”4405″ type=”tcp”> <selection name=”test-mode” enabled=”true”/> </connection> <connection port=”4406″ type=”tcp”> <selection name=”test-mode” enabled=”true”/> </connection> <option> <maxNumberOfDownloads>10</maxNumberOfDownloads> </option> </config> XSLT <?xml version=”1.0″?> <xsl:stylesheet version=”1.0″ xmlns:xsl=””> <xsl:output method=”xml” encoding=”utf-8″…

[Solved] Group Similar nodes in XML using XLST

This is a pretty straightforward grouping problem. If you’re limited to XSLT 1.0, you need to use Muenchian Grouping. If you’re using XSLT 2.0+, you can use xsl:for-each-group. Examples… XSLT 1.0 <xsl:stylesheet version=”1.0″ xmlns:xsl=””> <xsl:output indent=”yes”/> <xsl:strip-space elements=”*”/> <xsl:key name=”class”…

[Solved] Merge different products belong to each standard – V2 [duplicate]

This XSLT will do the thing: <xsl:stylesheet xmlns:xsl=”” xmlns:x=”” xmlns=”” exclude-result-prefixes=”x” version=”1.0″> <xsl:output indent=”yes” method=”xml” /> <xsl:template match=”x:Standards”> <Standards namespace=”{namespace-uri()}”> <xsl:apply-templates select=”.//x:Standard” /> </Standards> </xsl:template> <xsl:template match=”x:Standard”> <Standard> <xsl:copy-of select=”x:ProductID” /> <xsl:copy-of select=”x:Prefix”/> <xsl:copy-of select=”x:SNumber”/> <RelatedProducts> <xsl:apply-templates select=”.//x:RelatedProduct”/> </RelatedProducts> <xsl:copy-of…

[Solved] XML to HTML table using XSL

Just as a different approach and also handling the colours for the same bus_types.Demo <?xml version=”1.0″?> <xsl:stylesheet xmlns:xsl=”” version=”1.0″> <xsl:output method=”html”/> <xsl:template match=””> <table> <tr> <td colspan=”9″>ACME BUS SERVICE</td> </tr> <tr> <td colspan=”9″> Month: <xsl:value-of select=”//Month”/> </td> </tr> <tr> <td>Season</td>…