xslt

how can I add a part to xml using xslt and xsltproc?

I have an xml file : <?xml version="1.0" encoding="iso-8859-1"?> <Configuration> <Parameter2> </Parameter2> </Configuration> and I'd like to add following part to my xml file between <Configuration> and <Parameter2> parts. <Parameter1> <send>0</send> <interval>0</interval> <speed>200</speed> </Parameter1> ...

XSLT copy with modifications

Hi I'm stuck trying to work within these constraints, I'm using XSLT 1.0 {under .net}. I'd like to be able to do the following: i'm xsl:for-each'ing through a set of nodes of type <node> <data> unknown unstructured xml </data> <owner></owner> </node> i'd like to be able to output <node> <data> unknown unst...

using xslt how do i address this particular element in an xml file?

Never coded for XML before, totally lost with the various primers which all tell me to do something different. Which probably means you can do it different ways, but they all show single node situations and this isn't. I've tried various ways to pick out the WebDisplayPeriod but im convinced im not actually targetting the attribute of t...

XSL parse 2 xml file contemporary

Can xsl parse 2 XML file contemporary??? If true => How? ...

XSL Sort by position() giving weird results

I have an XML file whose contents I want to sort by document order (basically in the order that the items were written out). I currently use the following code: <xsl:template match="/Error"> <xsl:apply-templates> <xsl:sort select="position()" order="descending" /> </xsl:apply-templates> </xsl:template> <xsl...

XSL select all node where not node of another node

Thse is my xml <element1> <subel1/> </element1> <element2> <subel2/> </element2> <element3> <subel3/> </element3> <criteria> <subel3/> </criteria> how i can select all node with xsl that not are in criteria subnodes? like these <subel1/> <subel2/> How is this done? If the xml is formated as: <element1> <el> subel1 </el> </eleme...

XSLT Filtering and indices on node set

Hi, I'm trying to retreive the previous node in a for-each using the preceding-sibling axis, a filter and an indexer to find it. The problem is, I only want the first item that matches the XPath in the selector however, I seem unable to apply both the filter and the indexer. The indexer seems to override the filter so I always get the ...

Cannot get values from XML using XSLT

Hi all! I've got a question about XML and XSLT: I have this generated xml: <?xml version="1.0"?> <rootElement> <ClassSection> <Class name="Vehicle" base="Object"> <isPublic /> <isAbstract /> <Field specifier="private" fieldType="Int32" fieldName="numberOfWheels" /> <Field specifier="private" fieldType="In...

xsl merge elements and sort by date.

I have the following xml <Values> <New> <value>110</value> <date>2009-10-15</date> </New> <Previous> <value>100</value> <date>2010-10-15</date> </Previous> <Previous> <value>130</value> <date>2008-10-15</date> </Previous> </Values> I am using the following xsl <xsl:variable name="mergedData"> ...

Good books on XSLT

I'm doing an evaluation tomorrow that might include XSLT. I know what it is, and ten years ago I built an HTML table from an XML list. I would please like some book recommendations for non-so-dummies that I can scan tonight and at least be able to answer questions on XSLT tomorrow. ...

Selecting a child text node amongst white space text nodes, in a complex XML element using XPath

Hello, I've been racking my brain over this but can't seem to get it right, and I'm not hitting the correct keywords on Google.. I've recently started to play around with XSLT and XPath to create an XML description of natural language glossaries – for a project of mine. The problem is that I have chosen to use 'mixed content' compl...

Assign CSS class to element in an XSL

My XML file is as follows: <worksheet> <row> <rowTitle>RT1</rowTitle> <rowType>yesorno</rowType> <subLine>subLine1Content</subLine> <subLine>subLine2Content</subLine> </row> <row> <rowTitle>RT2</rowTitle> <rowType>operation</rowType> <subLine>subLine1Content</subLine> <subLine>subLine2Content</subLine> <subLine>subLine3Content</subLine>...

In XSL, how do I select a value, based on multiple attributes?

This has got to be a very basic question, but I'm really struggling with a solution. From the following XML, I'm trying to extract the first instance only, when I have a match on the tag="099" and the code="a" attributes in a marc:datafield node, and a marc:subfield node, respectively <?xml version="1.0" encoding="UTF-8" ?> <marc:colle...

how to add a param to xslt with xslt-ruby?

the title states it, essentially what is wrong here? I keep getting nothingness the param isnt getting passed... <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:param name="stylesheet"/> <xsl:template match="/"> <xsl:copy-of select="$stylesheet"/> </...

xslt returning first occurance of column

Hi, I have an xml document which looks like <book>xxxxxxxxxxx</book> <record> <field> <column>Title</column> <value>HF80</value> </field> <field> <column>page</column> <value>97</value> </field> ..... ... I need to print the "column" heading as a table row. I can get all the records in a table but dont kno...

Selecting parent/ancestor node based on value in child node.

Hello, My company makes a publication which outputs a clients current set of diagrams, You can search the publication for diagrams with a given attribute value. This works but only if the value is contained in the first Attribute node. Me and another fellow have been trying to fix it so that it searches all the attributes. Here is th...

XSL processor stack has overflowed - can't understand why

Hello guys, I'm trying to conditionally display the content of HTML page depending if a document being generated for a recognised company or not. However, the transformation doesn't work and I can't understand why :( I use MSXML3.0 as transformer and oXygen as IDE, which gives the errors I presented below. What I do is to construct a ...

XSL macros - how to create a macro that will replace "call-template" - "with-param" code

Hello, I'm trying to find a solution for how to replace standard 3-line code of type "call-template" - "with-param" with one single line. For example I have the following piece of code: <xsl:call-template name="do_job"> <xsl:with-param name="str">data1</xsl:with-param> </xsl:call-template> that i want to replace with something li...

XPath results from XSLT are incorrect - not going through entire XML

Hi! So I have a really confusing problem on my hands.. It seems as though that the entire XML data hierarchy is not being searched through when using an XPath expression in XSL. Some dummy XML data: <pets name="myPets" NUM="2"> <dog name="allMyDogs" NUM="5"> <dog name="Frank" NUM="3"/> <dog name="Spot" NUM="4"/...

Select element where attribute = "X"

I have the following XML <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="example3.xsl"?> <pics> <page no="1"> <pic> <td> <no src="http://www.templetons.com/brad/pq/playaphone.jpg" width="150" height="120">1</no> </td> </pic> <pic> <td> ...