xslt

XSLT Concatenating the values with comma (,)

hi All i need to loop through all the nodes in the xml document and append the values with comma ( , ) finally after the last element i should not have commma (,) can any body help me. thanking you, Ramana kumar. ...

Compare date-periods using XSLT

Hi there, I have some experience with XSLT but now i've got myself a problem: I need to check if a period between a begin- and enddate completely covers an other period. Here's a part of the xml: <Parent ID="1"> <StartDate>20050101</StartDate> <EndDate>20060131</EndDate> <Child ID="1"> <StartDate>20050101</StartDate> <En...

Distinct values from xml using xsl

Hi I have xml like <categories> <category> <LOC>USA,UK,Spain <LOC> </category> <category> <LOC>India,USA,China <LOC> </category> <categories> I don't want to get the USA two times when I am displaying LOC <xsl:value of select="$LOC/> I was thinking of using some variable <xsl:variable n...

How to pass an XML document as a parameter to an XSL transform in java (oracle xdk)?

I'm trying to pass an XML document to an XSLT stylesheet as a parameter. I believe the code is using the oracle XDK for transformations (it's using JDK 1.4.2, and Spring, and I'm new to the codebase, so I'm not sure what is getting loaded in the end). In my first attempt, I just created a document object and set this as the parameter on ...

How to display XSL-transformed XML in ASP.NET page?

So far all the XML / XSLT I've worked with takes an XML document and transforms it to a standalone HTML webpage using an XSLT file. In my web application, I'm using a web service to retrieve the XML document, which I need to render and make human-readable, and then insert that formatted content into a content placeholder in my master pa...

How to save newlines in XML attribute?

I need to save content that containing newlines in some XML attributes, not text. The method should be picked so that I am able to decode it in XSLT 1.0/ESXLT/XSLT 2.0 What is the best encoding method? Please suggest/give some ideas. ...

not getting multiple values of xml using xsl

I have xml like this <categories> <category> <Loc>India</Loc> <Loc>US</Loc> <Loc>Spain</Loc> <type>A</type> <type>B</type> <Cat>unknown</Cat> <SubCat>True</SubCat> </category> </categories> In my xsl when i m doing <xsl:for-each select="categories/category"> All locations:<xsl:value-of select="Loc"/> A...

XSLT: Using parent node's namespace

I would like to avoid producing a repeated namespace in my XSLT output. (I am using XSLT to massage some XML so that Microsoft's DataContractSerializer sees fit to actually process it properly. One of the things that the DCS doesn't seem to like is defining the same namespace multiple times.) I am taking all of the "Characteristics" el...

How to search a keyword in XML and scroll down the window to it?

Thanks to Bishiboosh and fmsf. As suggested, we're going to do it through XSL which looks more obvious answer of the problem (for detail please read below question). We'd have to create an XSL which will search a keyword and match with node name/value, attribute name/value etc. everything in XML. XML <?xml ver...

Large XML Files and Pagination, is it possible?

The problem When opening very large XML files locally, on your machine, it's almost a certainty that it will take an age for that file to open - it can often mean your computer locks down because it thinks it's not responding. This is an issue if you serve users XML backups of rather complex databases or systems they use - the likehood...

Is XslCompiledTransform to blame for slow XML transformation for a large file?

I am very new to XSLT, and the first thing that i need to do is parse a 300MB file (and that's on the small end). The XSLT is not that complex for the moment, it's just removing some nodes that match a certain criteria. I have two problems: It's too slow. It takes 50 seconds to process 500,000 records and that's not fast enough. It c...

How do I get XSLT to stop using scientific notation when outputting the results of numeric operations?

I have a bit of XSLT which is performing some magic on integer database identifiers. The relevant code snippit is <xsl:variable name="releaseId" select="@ID + $contentOffsetId"/> <xsl:attribute name="OLD_ID"> <xsl:value-of select="@ID" /> </xsl:attribute> <xsl:attribute name="RELEASE_ID"> <xsl:value-of select="$releas...

Pivoting XML using XSLT

Using XML in this format: <?xml version="1.0"?> <GetResult version="1.0"> <Fetch> <StartTime>2004-08-01 00:00:00</StartTime> <EndTime>2004-08-01 00:00:00</EndTime> </Fetch> <Items> <Item> <Name>Item Name Number 1</Name> <Data> <Datum> <Timestamp>2004-07-31 16:00:00+00:00</Timestamp...

xslt related problem

hi i have a proble with xml and xslt i have one xml file with some comment i want to uncomment it example <my-app> <name> </name> <!-- <class> <line></line> </class>--> </my-app> i want to uncomment this commented tag please help me in advance i am very new in xslt thanks in advance ...

javascript XSL in google chrome

Hi, I'm using the following javascript code to display xml/xsl: function loadXMLDoc(fname) { var xmlDoc; // code for IE if (window.ActiveXObject) { xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); } // code for Mozilla, Firefox, Opera, etc. else if (document.implementation && document.implementation.createDocument) { ...

How to get equivalent of max() on MSXML6?

Evidently MSXML6 doesn't support XSLT 2.0, at least not the max() function. I need to find out the node that contains the highest value among its siblings. They are in arbitrary order. I want the order to remain identical so adding order-by and checking [0] is out of question. I want to do this with a single XPath statement. I don't wa...

XPath format-number with number of decimal places based on a variable?

I have an XML document where the number of decimal places a particular xs:decimal should be reported in is held in a sibling node. I'm currently struggling to find a simple way to output this via the format-number function. I can build a picture string with some other functions, but this seems terribly long-winded for what should be (at...

XSLT: transfer xml with the closed tags

I'm using XSLT transfer an XML to a different format XML. If there is empty data with the element, it will display as a self-closing, eg. <data />, but I want output it with the closing tag like this <data></data>. If I change the output method from "xml" to "html" then I can get the <data></data>, but I will lose the <?xml version="1.0...

using variable value in href XSL

Hi, I knw its pretty basic question but I have just started reading it... I have a variable name <variable name="NAME"> http://www.yahoo.com/&lt;xsl:value-of select="$someothervariable"/> </variable> and i want to use it in like this I have used these two approaches but it didn't work <a href="{NAME}">HELLO</a> <a href="<xsl:valu...

Using XSLT concat() function in Select of for-each

I am trying to generate HTML which will display the data from XML through XSLT. The XML contains heading tags that are dynamically generated, like h1, h2, h3, h4 etc. Now in XSLT I want to dynamically access the h1, h2 and h3 in single for-each as the heading can be lesser in level, for example h1, h2 only or can be deeper in level like...