I have two XSLT file A.xslt and B.xslt, where A.xslt includes B.xslt.
A.xslt
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:my="my_namespace">
<my:data>This is A.xslt</my:data>
<xsl:include href="B.xslt"/>
<xsl:template name="my_template">
<xs...
Hi, I learned about XSLT and XPath at w3schools,but it's not exactly what I wanted..
There are only examples about transforming XSLT 2 HTML, this is pretty easy,but I need a XML 2 XML transformation and can't find a good tutorial with examples...I downloaded MSXSL.exe but can't find exempls about using it to transform XML...
Can anyone w...
Hi!
I wonder how to store xml data from one variable in another.
This works ($oldvariable contains xml data):
<xsl:variable name="newvariable" select="$oldvariable"/>
But this does not work (probably because of some obvious reason for an experienced XSLT-coder):
<xsl:variable name="newvariable">
<xsl:copy-of select="$oldvariable"...
I have the following xslt:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:my="my_namespace">
<xsl:template match="/">
<xsl:value-of select="document('')/xsl:stylesheet/namespace::my"/>
</xsl:template>
</xsl:stylesheet>
ant it always returns an empty...
Hi all,
I have some xml in the following format:
<fileExport>
<rows>
<row id="0">
<columns>
<column id="0">
<name>Date Time</name>
<value>2010-10-2 23:00:00 GMT</value>
</column>
<column id="1">
<name>Primary</name>
<value>100.1</value>
</column>
...
I want to remove preceding './' and first folder if it is not named 'screenshots'
So from
<image href="./folderx/screenshots/page1.png">
<image href="./screenshots/page2.png"/>
<image href="./views/screenshots/table/screenshots/page3.png"/>
to
<image href="screenshots/page1.png">
<image href="screenshots/page2.png"/>
<image href="...
Hello Stackoverflow!
I'm relatively new to XSLT. I've come across an issue that I don't know how to get around. I have an pretty large XML document that I am trying to transform to into another smaller, refined XML document.
The large XML document has this style:
<Property>
<name>Document name</name>
<value>SomeValue</value> ...
I have the following schema:
<parent>
<child id="1" name="Child 1 Version 1" />
</parent>
<parent>
<child id="2" name="Child 2 Version 1" />
</parent>
<parent>
<child id="1" name="Child 1 Version 2" />
</parent>
That I want to only handle the last node for each id. Below is what I have tried based on some reading:
<xsl:for-ea...
Let's say I have an xml document like this:
<director>
<play>
<t>Nutcracker</t>
<a>Tom Cruise</a>
</play>
<play>
<t>Nutcracker</t>
<a>Robin Williams</a>
</play>
<play>
<t>Grinch Stole Christmas</t>
<a>Will Smith</a>
</play>
<play>
<t>Grinch Stole Christm...
Im using the docbook2dita.xsl from the DITA open toolkit (although I had to modify it to xsl version 2.0) To convert my .xml files orginally created in docbook over to DITA now. A weird issue that I'm running into is the tags' contents are not being preserved:
Breadcrumb
<para xreflabel="New Consent Type" id="manageNewConsentTyp...
Hi All
I'm trying to combine the official jQuery accordion plugin with another JQ plugin called 'GallerificPlus' (Gallerific & Lightbox in 1).
Unfortunately it doesn't work for me. The GallerificPlus is the one that doesn't work, the accordion works fine. Firebug reports no errors, so this could be anything. It's really frustrating.
...
Hello...I am transforming an XML where I am supposed to locate a particular Element (based on the attribute value) and update the Element and its child attributes.
The sample XML file is as below.
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<Environments>
<Environment id="Master"/>
<Environment id="Deve...
I've got some *.xml with elements like :
<app-method name="leave-accrual-status-details" kind="enquiry">
<title>...</title>
<required-roles>
<role name="authenticated"/>
</required-roles>
<asd>
<param name="..." datatype="dt:int" control="hidden" call-kind="..." data-kind="..."/>
</asd>
<data-engine s...
I have an XML file with information, for example:
<letter>
<name>Test</name>
<age>20</age>
<me>Me</me>
</letter>
And then I have an text template like:
Dear $name,
some text with other variables like $age or $name again
greatings $me
When using xslt to transform the XML to the plain text letter I can use something like:
<x...
I want to change the values of the @page attributes of <line/> that are descendants of <section type="cover"/> to (max(@page) + 1) of <section type="contents"/>.
Basically I need the page number for the cover section to be 1 higher than the last numeric page number of the contents section.
Note: <line/> nodes are not always siblings, ...
I'd like to trim the leading whitespace inside p tags in XML, so this:
<p> Hey, <em>italics</em> and <em>italics</em>!</p>
Becomes this:
<p>Hey, <em>italics</em> and <em>italics</em>!</p>
(Trimming trailing whitespace won't hurt, but it's not mandatory.)
Now, I know normalize-whitespace() is supposed to do this, but if I try to a...
My requirement is to update an XML file (some elements identified via a parameter, with new attribute values again identified via a paramenter).
I am using XSLT to do the same via C# code.
My code is as below:
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(f_Xslt);
XmlReader xr = XmlReader.Create("SourceXML.xml")...
I need to rearrange all the the child elements of an XML Document underneath the first Parent (and discard all other parent info)
In the example below, I need all 4 child elements under Parent[ParentField=1] and discard Parent[ParentField=X]
<xml>
<Parent>
<ParentField>1</ParentField>
<Children>
<Child>
...
I have a simple XML, that I want to add a new root to. The current root is <myFields> and I want to add <myTable> so it would look like.
<myTable>
<myFields>
.
.
</myFields>
</myTable>
...
I am new to docbook, but can not find a decent way to write some pieces of html code directly in the docbook xml structure. The best I could find was dbhtml-include, but it requires a separate html file to parse.
Is it possible to write a few html lines directly ?
What I am actually trying to do is to write math with mathjax inside do...