xslt

Select unique nodes based on a combination of two attribute values

Hi, I have some XML that looks something like this: <Root> <Documents> <Document id="1"/> </Documents> <People> <Person id="1"/> <Person id="2"/> </People> <Links> <Link personId="1" documentId="1"/> <Link personId="1" documentId="1"/> <Link personId="2" documentId="1"/...

How do I conditionally copy XML elements using XSLT?

Hi, I am trying to conditionally copy nodes using XSL. Here is my XML: <root> <node_a>111</node_a> <node_b>222</node_b> <node_c>333</node_c> </root> How do I just copy all the nodes EXCEPT for "node_a" using XSLT? TIA ...

XSLT Stylesheet switcher

Is there a way to switch a CSS stylesheet using XSLT? We are trying to do this without Javascript or include different files based on what CSS Stylesheet is used. Example: XSLT for normal view. Click a link and switches the stylesheet to view a Text Only view for accessibility and screen readers to use. At the same time getting rid o...

retrieving XML value dynamically using XSL function

my input xml file looks like <root> <sub> <element1 value="abc"/> <element2 value="123"/> </sub> <sub1> <element1 value="ert"/> <element2 value="abc"/> </sub1> </root> i need an XSLT function which reads below XML file and pulls the xpath expression value specified at map/domain/instance/@xpath from above f...

How to set the base URI for an XSLT script?

Is there a way to set the base URI in XSLT so it applies for the whole document like in XQuery? I.e. declare base-uri = "someuri"; ...

Editing an html file like xml file

Hi, I need to convert HTML file to iXBRL format. iXBRL format is basically html with some embedded nodes or some information of html file wrapped under ixbrl tags. For this, I will need to SEARCH and REMOVE some nodes from HTML file and WRAP some nodes under iXBRL tags. I'm not able to use XML DOM as it shoots an exception on content t...

xsl asp.net open source projct

can any one indicate a asp.net open source project based on xsl? Thanx. ...

Adding namespace to child elements using xslt

below is the input xml: <ns:TXLife xmlns:ns="http://ACORD.org/Standards/Life/2"&gt; <TXLifeResponse> <TransRefGUID/> <TransExeDate/> <TransExeTime/> <TransType tc="228"/> </ns:TXLife> and below is my XSLT : xmlns:ns="http://ACORD.org/Standards/Life/2" version="1.0"> <xsl:output omit-xml-declaration="y...

Why can't I use values of nodes I retrieve by using exsl:node-set/set:distinct in an XPath-Expression?

Hello there. In a xslt-stylesheet I'm using the methods exsl:node-set and set:distinct to access and filter unique nodes from a variable that contains a result tree fragment. I can write the values of these nodes into my output file, example: <xsl:variable name="myNodes"> <xsl:call-template name="getNodes"/> </xsl:variable> <xsl:for...

xsl transformation

Hi all, I am new to xsl transformations and I have a question. I am looping through an xml like this: <PO> <Items> <Item> <Price>2</Price> <Quantity>5</Quantity> </Item> <Item> <Price>3</Price> <Quantity>2</Quantity> </Item> </Items> <QuantityTotal></QuantityTotal> </PO> Now I want to insert a valu...

Need help with XSLT

Hello, I don't know anything about XSLT but I need it for a one time thing. This should be pretty simple to do. What would the XSLT need to be to take the following input and display as what is shown below. INPUT: <TestResult> <set-value idref="account_lockout_duration_var">900</set-value> <set-value idref="account_lockout_threshold_va...

Evaluate outer xpath-expression in xpath-predicate

Hi, i have a problem with a xpath-statement. Basically, the problem can be explained at the following code: <xsl:for-each select="/b1im:B1IMessage/b1im:Header/b1im:Z/SortInbound/group"> <!-- Check if entry from duplicate table is found for the current AccountingEntry --> <xsl:variable name="exter...

XSLT apply-template with mode - Incorrect result with no matching mode

Hi! Here's a simple case. Here's my XML: <?xml version="1.0" encoding="utf-8" ?> <dogs> <dog type="Labrador"> <Name>Doggy</Name> </dog> <dog type="Batard"> <Name>Unknown</Name> </dog> </dogs> This XML is used with two Xslt. This is the common one: <?xml version="1.0" encoding="utf-8"?> <xsl:styleshee...

Detailed View with XSLT

Is there any way to make a single XSLT file to show an overview list over a CD collection and a detailed view for single CD? XML file <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90...

XSL / Schemas beginners question

Been using XML for ages now for data storage & transfer, but have never had to validate or transform it. Currently starting a new project and making some design decisions and need to know some rudimentary things about XSL & Schemas. Our XML is like this (excuse the boring book example :) ): <Books> <Book> <ID>1</ID> <Name>Boo...

Parsing HTML in Android: no XSLT? What to use?

In need in my application to fetch remote HTML document and parse some parts out of it. As I don't want to play with string parsing, which would be really lots of work, I thought about using XSLT, which would let me build small XML document out of HTML and then read it easy. Seems there is no XSLT support in Android? What other ways I c...

XSLT files for SLD XML

Good morning everyone. I'm working on a SLD related project and was wondering if there were any XSLT files already created for transforming one version of SLD to another. I'm creating 1.1.0 files and would like to downgrade the files down to 1.0.20 or 1.0.0. Thanks. ...

How could I optimize the XPath test not(previous-sibling::sect1) for testing whether this is the first sect1 child element?

I'm developing an XSLT 1.0 stylesheet (and apply it using xsltproc). One of the templates in my script should perform some special handling for the first <sect1> element in a given parent node and some for the last <sect1> element. Right now this special handling is implemented like this: <xsl:template match="sect1"> <xsl:if test="not...

xslt parsing xml to generate word document

i have an xlst file that is supposed to parse an xml file and generate word document. But when i parse it in visual studio it produces another xml because its header is: <xsl:output method="xml" omit-xml-declaration="no" version="1.0" encoding="utf-8" standalone="yes" /> <xsl:template match="/"> <xsl:processing-instruction name="mso...

General substitution over all XML (XSLT)

Basically, what I'm doing right now is running an XSLT, then opening the result in Visual Studio and doing a find and replace for one word - for this example, I want to change all instances of "bar" to "myBar". All instances of "bar" may be assumed to be in text elements like so: <someElement>bar.whatever</someElement> This would be t...