xslt

Dynamic grouping on element and attributes names

Hi! I would like to categorize results from an XPath under headings by element name (and then by same attribute names). Note: XML data could be inconsistent and some elements with the same name could have different attributes, therefore they need different headings. I can't seem to write out my problem in words, so it might be best to...

How to generate a failure at runtime in an xslt?

I need to generate a runtime error in an xslt. How to do so? The following xpaths do not generate runtime errors: "1 div 0" "/*/*[1 div 0]" "/*/*[0]" "/*/*[NaN]" It does not have to be done using xpath, could be done using some xslt construct. The reason I want this is to effectively have a "NotImplementedException" in my xslt. T...

relative path problem with Firefox

Hi, I have a question: relative path problem with Firefox.. I've the folder Order with the order.xml an other folder is Source with code.xsl In order.xml I've the string: <?xml-stylesheet type="text/xsl" href="../Source/deliveryNote.xsl"?> With IE all right but, Firefox not ok! Thanks! Gb ...

How to map PCDATA between two empty tags into one tag?

Hi All, I have this following doubt in xslt coding. my input is : <text><p>some text</p> <p/>some text <emph>....</emph>.........<p/> </text> And the output that i need is <text><p>some text</p><p>some text <emph>....</emph>.........</p></text> How am i supposed to map the values present between two empty "p" tags in to a non...

Why do indexes in XPath start with 1 and not 0?

Some colleagues and I were comparing past languages we had programmed in and were chuckling about our experience with VBScript with its odd features such as 1-based index instead of 0-based indexes like almost every other language has, the reasoning being that it was a language for users (e.g. Excel VBA) instead of a language for develop...

how to for every parent node select every not first child node in a tree with multiple parent nodes

His, I think I've got a tricky questions for XPath experts. There is a node structure like this: A(1)-| |-B(1) |-B(2) |-B(3) A(2)-| |-B(2.1) |-B(2.2) |-B(2.3) ... How to, with a single XPath-expression, extract only the following nodes A(1)-| |-B(2) |-B(3) A(2)-| |-B(2.2) |-B(2.3) ...

how to add xsl attribute

I have an xml with img tag <img> source </img> I want to generate: <img src="source.jpg"> I tried something like that: <img> <xsl:attribute name="src"> <xsl:text> <xsl:value-of select="node()" />.jpg </xsl:text> </xsl:attribute> </img> but it doesng work ...

How can I select the first element of a node with XSL?

I'm coding my first website using XML+XSL. The xml I am transforming have this section: <page> <news> <highlights> <entry> <mini>x_thumb.jpg</mini> <title>title</title> <text>text</text> <image>x.jpg</image> <link>x.html</link> ...

In XPath 1.0, how can I test whether a string with length 1 falls between two others codepoint-wise?

Given a document containing these tags, how can I tell whether " " < "H" < "z" in the document's encoding? I'm trying to do this in XPath 1.0. <text>H</text> <range> <from>&#x20;</from> <to>z</to> </range> I might even be able to get away with using contains(), but then how would I create a string containing the characters from "...

xsl:for-each file in directory(common solution)

Hello, I found solution for subj related to the Visual Studio XSLT processor: public class XsltListFilesExtension { public XPathNodeIterator ListFiles(string directoryPath) { XmlDocument doc = new XmlDocument(); doc.AppendChild(doc.CreateElement("files")); DirectoryInfo di = ne...

XSL nested for each postion problem

first off hello Ok my question, i am trying to develope a open source shopping cart, which uses xml for storage and xsl to style the basket 1, my xml <items> <item> <item-name>vlaue</item-name> <item-number>vlaue</item-number> <quantity>vlaue<quantity> <option> <on0>vlaue</on0> ...

Problem with XSLT getting values from tags with namespace prefixes

I have a specific problem getting values for width and height out of some XML that has namespace prefixes defined. I can get other values such as SomeText from RelatedMaterial quite easily using normal xpath with namespace "n:" but unable to get values for width and height. Sample XML: <Description> <Information> <GroupInformation xml:...

It is possible to set a priority on a "group-starting-with"-clause?

Hello, this is an example of my input file. <root> <!-- [...] --> <bbb>Foo 1</bbb> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <bbb>Foo 2</bbb> <ccc>Foo 2.1</ccc> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <bbb>Foo 3</bbb> <ccc>Foo 3.1</ccc> <aaa>xxxx...

Does xslt have split() function?

i want to split the string based on some separator. for e.g returns Topic1,Topic2,Tpoic3 as string. i want to split the string based on ",", the way we have in C#. Final output should be Topic1 Topic2 Topic3. Regards, Ketan ...

Using two elements for xsl:key key

I know that if I have an XML file like this: <persons> <class name="English"> <person name="Tarzan" id="050676"/> <person name="Donald" id="070754"/> <person name="Dolly" id="231256"/> </class> <class name="Math"> <person name="Winston" id="050677"/> <person name="Donald" id="070754"/> ...

how to transform with this source and target document?

I have the XML source file in SVG present like this: <svg> <g id='a001' class='pools'> <g id='b001' class='pool' name='Proc111'> <g id='c001' class='lane' name='User111' PoolID='b001'> <g id='d001' class='startevent' name='startevent111' LaneID='c001'></g> </g> <g id='c002' class='lane' name='User22...

Xslt collection as parameter.

Hello, Could you help me to answer how to put collection of data as parameter in the xslt file, is it possible ? Thanks. ...

what // in xslt?

what // in xslt? e.g. ($currentPage//node) ...

XSLT - Match variable element in predicate

<xsl:apply-templates select="element[child='Yes']"> Works fine but I would like to use <xsl:apply-templates select="element[$childElementName='Yes']"> so I can use a variable to specify the node. For example <xsl:apply-templates select="theList/entity[Central='Yes']"> works fine against: <?xml version="1.0" encoding="utf-8"?> ...

XSLT processing problem with asp specific code

I have asp file with code below: <html> <head> <link rel="stylesheet" href="<%=bb_style%>"/> <title>asdf</title> </head> I need to include title from this file into another asp file formed by xslt transformation. I use this code: <xsl:value-of select="document(content)/html/head/title"/> But I have nothing ret...