xsltprocessor

XSLT parsing multiple lines

<data> <Attributes> <Attribute name='somethingelse' value='blah'/> <Attribute name='forms'> <List> <String>xform</String> <String>yform</String> </List> </Attribute> </Attributes> </data> I am already parsing the xslt at Attributes level, so I can get the value blah by just doing <xsl:value-of select="Attribute[...

Sharepoint (MOSS) XSL - PageUrl parameter not being found/displayed

I have a Data View Web Part, on a custom edit Page for a list. I want to grab the current URL and pass it to the next page, so I can return to the editing screen. I have followed these instructions to display the current page URL: http://www.stevesofian.net/post/XSLT-Tip-Get-Current-Page-URL.aspx Inside of Sharepoint Designer, the Url ...

No XSLTProcessor() support in Safari?

For whatever reason, I can't get XSLTProcessor() to work all the time. Here is my JS: ... xsltProcessor = new XSLTProcessor(); xsltProcessor.importStylesheet(xmlRequest.responseXML); // Pass variables xsltProcessor.setParameter(null, "sectionNumber", section); xsltProcessor.setParameter(null, "entryNumber", elementNo); // Tr...

Multiple PHP Warnings in XSLTProcessor::importStylesheet()

Errors: Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: Undefined variable in /transform.php on line 24 Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: compilation error: file /protocols.xsl line 18 element template in /transform.php on line 24 Warning: XSLTProcessor::import...

Can XSLT processors be multi-threaded?

Hi everyone, I'm fishing for approaches to a problem with XSLT processing. Is it possible to use parallel processing to speed up an XSLT processor? Or are XSLT processors inherently serial? My hunch is that XML can be partitioned into chunks which could be processed by different threads, but since I'm not really finding any documentat...

How to apply custom ItemStyle.xsl to CQWP

Hello all I got a question about applying custom itemstyle.xsl to CQWP. I extracted existing CQWP, renamed it, and uploaded to webpart gallery on a site collection. The modified CQWP web part worked with no problem at all under default itemstyle.xsl After that, i copied itemstyle.xsl, renamed it to customitemstyle.xsl, and uploaded ...

Optimising XDocument to XDocument XSLT

The following code works but is messy and slow. I am transforming an XDocument to another XDocument using XSLT2 with Saxon, adapted using SaxonWrapper: public static XDocument HSRTransform(XDocument source) { System.Reflection.Assembly thisExe = System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Stream xslfile = thisEx...

XSLT template select and match issue

Hello everyone, I am confused about how this XSLT apply-template statement works for cd/title/artist elements in the w3school sample, http://www.w3schools.com/xsl/xsl_apply_templates.asp Here is the code snippet I am confused, I am confused when xslt processor finds <xsl:apply-templates/> in below sample, it will match all child nodes...

XSLTProcessor() browser support

What browsers and of what "vintage" support the XSLTProcessor() object? ...

Browser rendering XSLT vs PHP rendering XSLT

I use XML and XSLT in my current project and I would like to know if it's good to let the browser render the XML into HTML with stylesheet instead to use something like the PHP xsltprocessor. One main reason I use the Browser xslt processor is to allows API to access my XML data in a near future. So I want the transformation client-side...

if defined in XSLT

How I can check defined variable $var01 or not? The problem there are: <input type="text" name="search_do" style="width: 150px;" value="{$search_do}" /> But it isn't work, I have a message "runtime error" if $search_do isn't defined. P.S. I can't edit php back-end, just XSL template ...

How a compiled XSLT works on IIS?

My XSLT was compiled via xsltc, the performance is hugely improved. However, I am wondering how the compiled XSLT works on IIS? Will there any cached of the compiled XSLT instance on the IIS after 1st JIT'ing. As I am seeing my page slightly slow in response from server, but if the page after being called once, subsequent access to the p...

How to get position of parent element - XSL

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/> ...

DOCTYPE declaration getting lost when using XSL

The input to my XSL is an XHTML. After applying the XSL the DOCTYPE declaration that was present in the input XHTML gets lost in the output. Do i have an option to copy/retain the DOCTYPE declaration in the output using XSL. The XSL processor that i am using is SAXON. ...

Adding <span> tags to all text nodes between custom self closing tags.

I have a pair of custom self closing tags s1 and s2 defined in namespace x in my xhtml. For each tag pair s1, s2 having the same id, I want to add span tags to all the text nodes between them. Each s1, s2 tag pair have a unique id. i am looking for a XSL based solution for the same. I am using Saxon java processor for XSL. Sample input...

How do i select all text nodes between two elements, using XSL?

I want to get the generate-id(.) of all the text nodes after node <m/> and before node </n>. I am looking for some generic XSL and not tightly coupled to the sample input pattern mentioned below. For any input pattern i want to get the ids of all the text nodes between node <m/> and <n/>. Sample input for better understanding: <a> <b...

How do i modify the XSL to change the xml format.

In the below XSL every time the xsl:when gets satisfied I want to append as many <a> and </a> tags. But the data that needs to be populated inside the tags should be only once. I have shown the expected output at the end. <xsl:param name="insert-file" as="document-node()" /> <xsl:template match="*"> <xsl:variable name="input">My text<...

Actual element tags are not getting captured.

I am using the below piece of XSL code to construct a span tag calling a javascript function on mouseover. The input to the javascipt should be a html table. The output from the variable "showContent" gives just the text content but not along with the table tags. How can this be resolved. XSL: <xsl:variable name="aTable" as="...

Problems with Xalan and Java JDK 1.5

From what I believe and have read online. Sun has decided to include Xalan in JDK 1.5. I am trying to take advantage of this and try to perform an XSLT to spit out multiple files. The problem I encounter: 'Unrecognized XSLTC extension 'org.apache.xalan.xslt.extensions.Redirect:write''" From what I have read on google that i needed to c...

Improving the performance of XSL

I am using the below XSL 2.0 code to find the ids of the text nodes that contains the list of indices that i give as input. the code works perfectly but in terms for performance it is taking a long time for huge files. Even for huge files if the index values are small then the result is quick in few ms. I am using saxon9he Java processor...