xslt-2.0

XSL parameters using JavaScript

狂风中的少年 提交于 2019-12-10 11:55:57
问题 I have a html page like: <html> <head> <script> function loadXMLDoc(dname) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET",dname,false); xhttp.send(""); return xhttp.responseXML; } function displayResult() { xml=loadXMLDoc("1.xml"); xsl=loadXMLDoc("2.xsl"); // code for IE if (window.ActiveXObject) { xml.addParameter("rss", test); ex=xml.transformNode(xsl); document.getElementById("example").innerHTML=ex; } //

Can we do XSLT 2.0 with Netbeans 7?

夙愿已清 提交于 2019-12-10 11:29:30
问题 In its current form, Netbeans only supports XSLT 1.0 and does not support XSLT 2.0. How do we use XSLT 2.0 with Netbeans 7? 回答1: How to make Saxon the JRE-installation-default XSLT Processor: (So not only for Netbeans, other Java applications might be impacted as well.) Get Saxon for Java (there are different editions, pick the one suitable for you) and copy saxonXYZ.jar to the jre/lib/ext dir. In the jre/lib dir create a jaxp.properties file with following content: javax.xml.transform

Use a variable for a namespace in an XSL transform

为君一笑 提交于 2019-12-10 06:03:57
问题 This is probably a duplicate, but I haven't found the answer from any other posts so I will go ahead and ask. Inside an XSL file, I'd like to have variables that are the namespaces that will be output. Something like: <xsl:variable name="some_ns" select="'http://something.com/misc/blah/1.0'" /> Then in a template, do this: <SomeElement xmlns="$some_ns"> I have had no luck getting this work, even though it seems rather simple. Thanks for your time. 回答1: To set namespaces dynamically at runtime

XSL Analyze-String -> Matching-Substring into multiple variables

被刻印的时光 ゝ 提交于 2019-12-09 11:42:03
问题 I was wondering if it is possible to use analyze-string and set multiple groups within the RegEx and then store all of the matching groups in variables to use later on. like so: <xsl:analyze-string regex="^Blah\s+(\d+)\s+Bloo\s+(\d+)\s+Blee" select="."> <xsl:matching-substring> <xsl:variable name="varX"> <xsl:value-of select="regex-group(1)"/> </xsl:variable> <xsl:variable name="varY"> <xsl:value-of select="regex-group(2)"/> </xsl:variable> </xsl:matching-substring> </xsl:analyze-string> This

Need to add sublist in between closing para and item and footnote inside closing para

試著忘記壹切 提交于 2019-12-08 14:08:24
I want to add the sublist inside item and footnote text inside list para: My source xml: <body> <p>blahblah</p> <ul outputclass="l1"> <li outputclass="lt1">blahblah</li> <li outputclass="lt1">blahblah</li> <li outputclass="lt1">blahblah <ul outputclass="l2"> <li outputclass="lt2">blahblah</li> <li outputclass="lt2">blahblah<fn><p>blah</p></fn></li> <li outputclass="lt2">blahblah <ul outputclass="l3"> <li outputclass="lt3">blahblah<fn><p>blah</p></fn></li> <li outputclass="lt3">blah<fn><p>blah</p></fn>blah</li> <li outputclass="lt3">blahblah</li> </ul></li> </ul></li> <li outputclass="lt1"

how to get date difference in xslt

两盒软妹~` 提交于 2019-12-08 13:42:26
问题 My Schema is : <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:datetime="http://exslt.org/dates-and-times" xmlns:fn="http://www.w3.org/2005/xpath-functions"> I am trying to get difference between two date . No clue. 回答1: Example to get date difference is: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:param name="currentDate" select=

How to generate random UUID using xslt

随声附和 提交于 2019-12-08 10:13:56
问题 I am newbie to xslt. i want to generate 32 digit long UUID using xslt and add it to the xml coming as an input. I tried to use the random function of math liberary but getting error. Input XML <users xmlns="ABC_Login"> <email>ABC@gmail.com</email> </users> XSLT Snippet <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="ABC_Login" xmlns:math="http://exslt.org/math" extension-element-prefixes="math" version="2.0"> <xsl:template

strip html tag from xml using xslt

落花浮王杯 提交于 2019-12-08 08:37:19
问题 i want to fetch normal text from xml which one field containing html data.i cant put condition on template.pls suggest me any solution. <?xml version="1.0" encoding="UTF-8"?> <workdetail> <field name="summaryText1"><UL style="MARGIN-TOP: 0in" type=disc> <LI style="TEXT-ALIGN: justify;MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="mso-fareast-font-family: 'timesnewroman'; mso-bidi-font-family: calibri; mso-bidi-theme-font: minor-latin; mso-bidi-font-style: italic"><FONT size=2>Manage the

backbone app not calling in xsl but works fine in my local

空扰寡人 提交于 2019-12-08 06:57:17
问题 I am trying to call the backbone app through xsl... its working fine...but the problem is when i put inside a function its not working... i tested with console.log inside that function..i am able to see console log...but its not calling backbone app,, providing my code below... the same function working fine when i dont put in xsl thats is when i test it in my local... do i need to include anything in my xslor upgrade xsl...i dont see my app rendering in browser through xsl...but it works

XSLT 2.0 - Keep default element, remove duplicate siblings, filter unnecessary entries by attribute

旧街凉风 提交于 2019-12-08 06:42:37
问题 Using XSLT 2.0. I need to filter all elements that have attribute @xml:lang where the attribute's values are not in a list of possible values I define. Ex allowable values: x-default , en , en-US , en-GB When @xml:lang is detected on any element, and if x-default exists, then any sibling element of same type with @xml:lang value other than x-default should be compared to the element's text value of x-default , and if same element text value, be removed. To say that another way, any sibling