What I wish I could do in xsl is the following, but unfortunatly parent/position() is not valid.
XSL
<xsl:template match="li">
<bullet>
<xsl:apply-templates/>
</bullet>
<!-- if this is the last bullet AND there are no more "p" tags, output footer -->
<xsl:if test="count(ancestor::div/*) = parent/position()">
<footer/>
...
Hello all
I have a webservice that returns an XML like this:
<?xml version="1.0" encoding="UTF-8"?>
<contractInformation>
<contract>
<idContract type="int">87191827</idContract>
<region type="varchar">null</region>
<dueDate type="varchar">null</dueDate>
<contactName type="varchar">John Smith</...
I have a xml document. I know the index where i need to insert the new node. The index that i have is the position considering only the text nodes and ignoring the element tags. Is there a java api to seek the index in a xml knowing the position relative to the text nodes alone and insert a new node in that position?
...
Is it possible for me to have a conditional in XSLT such that I find and replace only the FIRST tag of a particular tag name?
For example, I have an XML file with many <title> tags. I would like to replace the first of these tags with <PageTitle>. The rest should be left alone. How would I do this in my transform? What I currently have ...
Hello,
What I'm trying to do is fairly simple, but I can't find the way to. I just want to iterate over the children of a node excluding the first child.
For instance, in this XML snippet, I would want all the <bar> elements, except the first one:
<foo>
<Bar>Example</Bar>
<Bar>This is an example</Bar>
<Bar>Another example<...
I've added an object to the XsltArgumentList. I was wondering how I could access and display it in my transformation?
xslarg.AddExtensionObject("someKey", "someValue");
However, when I transform, I wan't to be able to display "someValue".
Any idea how? Thanks.
...
Hi,
I've got a problem with xsl:include and default namespaces which is causing the final xml document contain nodes with the xmlns=""
In this synario I have 1 source document which is Plain Old XML and doesn't have a namespace:
<?xml version="1.0" encoding="UTF-8"?>
<SourceDoc>
<Description>Hello I'm the source description</Descr...
This may be a really simple question, but its one I can't seem to get and am tearing my hair out over. I have the following XML:
<?xml-stylesheet type="text/xsl" href="email.xsl"?>
<Example xmlns="">
<Name xmlns="urn:rnb.fulfilment.bus.contracts.public.exampleBookName.v1">Mark</Name>
</Example>
And am trying to use the following XSL...
Does anyone have an XML style sheet that'll convert wiki-like markup to HTML? Or is that a bad idea? I only found one style sheet that'll convert HTML to wiki-like markup, view-source:http://mozile.mozdev.org/0.8/demos/html2wiki.xsl . Or is this a bad idea? Basically, instead of following strict rules with my XML tags to format my conten...
I must transform some XML data into a paginated list of fields. Here is an example.
Input XML:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<books>
<book title="t0"/>
<book title="t1"/>
<book title="t2"/>
<book title="t3"/>
<book title="t4"/>
</books>
<library name="my library"/>
</d...
I need help transforming an XML file, whose part of it is with escape sequences, into HTML:
<?xml-stylesheet type=text/xsl href=XSL_17.xsl?>
<Root>
<Book>
<Author>John smith</Author>
<Genre>Novel</Genre>
<Details><?xml version="1.0" encoding="utf-16"?><Dets><Ds><D DN="Pages" DV="381" /><D DN="Bin...
What are good tutorials for that? I mean NOT the ones like
"Hi! Today we'll transform <xml>Hello World</xml> to <h1>Hello World<h1>! Good start! Keep learning!"
Something like "xlst for 21 days", or "xslt: from novice to professional" :)
Thanks, Ilya.
...
I have a situation where loop through a sorted nodeset and apply a template on each of the nodes:
<div id="contractscontainer">
<xsl:for-each select="document">
<xsl:sort select="content[@name='ClientName']/text()" />
<xsl:apply-templates select="." mode="client-contract" />
</xsl:for-each>
</div>
I want to do something sp...
I'm working on an interface with a 3rd party app that basically needs to take XML that was spat out by the app and convert it into XML our system can deal with. It's basically just applying a stylesheet to the original XML to make it looks like "our" XML. I've noticed that in other stylesheets we have, there are constructs like this:
...
My RDF xml file is something like this..
<rdf:RDF>
<rdf:Description rdf:about="........">
<j.0:property rdf:resource="....."/>
<j.0:property rdf:resource=....."/>
<j.0:property rdf:resource="........"/>
</rdf:Description>
</rdf:RDF>
Now in my XSLT stylesheet I need to retrieve the values of all the j.0:...
I have an XML page with some elements in various languages - Arabic, English, Chinese, Japanese.. Which encoding format should I have to choose for that? If I try to render the XML with an XSL (using utf-8 or ISO-8859-6 or ISO-2022-JP), I get this error:
An invalid character was found in text
content.
How shall or solve this?
Th...
I am having some problems with an XML transform and need some help.
The stylesheet should iterate through all suffix elements and place the contents without the suffix tag next to the last text node within its first ancestor quote-block element (see desired ouput). It works when only a single suffix is present, but not when 2 are prese...
Is there a way to deserialize a XML stream using XmlSerializer by applying a custom tranform defined in a XSLT?
...
I use the ddwrt:FormatDateTime function to format the output like yyyyMMdd.
inputs like 01/01/2010 work fine but when the day gets over the number 12 the output is an emtpy string.
ddwrt:FormatDate(string(@myDate), 1033, 'yyyyMMdd')
At first I thought it could be a language specific problem but even none of those combinations work:
1...
Hi
I have the folowing XML
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <DEVICEMESSAGES>
<VERSION xml="1" checksum="" revision="0" envision="33050000" device="" />
<HEADER id1="0001" id2="0001" content="Nasher[<messageid>]: <!payload>" />
<MESSAGE level="7" parse="1" parsedefvalue="1" tableid="15" id1="24682" id2="24682" eve...