node-set

querySelectorAll: manipulating nodes

我只是一个虾纸丫 提交于 2019-12-22 04:13:10
问题 As far as I have understood, querySelector returns a real changeable element while querySelectorAll returns a non-live Static Node Set. I want to adjust the style of all elements fitting to a specific selector. It works fine for the first element with querySelector , but not for all matching elements with querySelectorAll . I guess that's because the node set is non-live. Is there a workaround? Or am I missing something? 回答1: The problem is that querySelector returns a single node.

build node-set variable from result tree fragment using <xsl:choose>

試著忘記壹切 提交于 2019-12-18 09:31:34
问题 Is it possible to create a node-set variable from an rtf using xsl:choose (for use in MSXML engine)? I have the following construct: <xsl:choose> <xsl:when test="function-available('msxsl:node-set')"> <xsl:variable name="colorList" select="msxsl:node-set($std:colorList)"/> <xsl:for-each select="$colorList/color"> tr.testid<xsl:value-of select="@testid"/> { color:<xsl:value-of select="."/>; } </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:variable name="colorList" select="$std:colorList"/>

XSLT v1.0 Updating attribute in node-set based on previous node's attribute

帅比萌擦擦* 提交于 2019-12-12 03:47:02
问题 I have the following XML file. <Record Name="My_Record" <Fields StartingBit="0" Size="3" Name="Field_1"> </Fields> <Fields StartingBit="1" Size="5" Name="Field_2"> </Fields> <Fields StartingBit="2" Size="8" Name="Field_3"> </Fields> <Fields StartingBit="3" Size="4" Name="Field_4" </Fields> </Record> And I would like to use XSLT to properly update the @StartingBit attribute from the previous node's @StartingBit + @Size - this will be the current node's @StartingBit value. The resulting XML

Resolving subelements of a variable that has been passed into a template

馋奶兔 提交于 2019-12-11 19:39:35
问题 data.xml: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="myxslt2.xslt"?> <data> <foo>Hello</foo> <bar>World</bar> <foobar>This is a test</foobar> </data> myxslt2.xslt <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" version="1.0"> <xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"

Unable to cast from XRTreeFrag into XNodeSet

南笙酒味 提交于 2019-12-11 04:53:08
问题 I have the following test code... I am trying to pass a node-set as a param. After many hours, i finally was able to pass it to my template. How I pass my node-set to the template: <xsl:call-template name="listing"> <xsl:with-param name="customData"> <xsl:apply-templates select="exslt:node-set($data)"/> </xsl:with-param> </xsl:call-template> How my template receives it: <xsl:template name="listing"> <xsl:param name="customData" select="/.."/> <xsl:variable name="data"> <xsl:choose> <xsl:when

detect availability of node-set() function in xslt implementation of icecast server

拈花ヽ惹草 提交于 2019-12-09 20:08:46
问题 Icecast contains an XSLT implementation based on libxslt from xmlsoft. I want to know if it supports the node-set() function, preferably in a way that works for other web-only environments too: Regrettably, the XSLT processor in icecast is only web accessible through the web interface of the icecast process (so no xsltproc on the commandline). To worsen it: there is limited logging of the XSLT errors (when you do things wrong, the icecast process often just dies). I'm running icecast 2.3.2 as

querySelectorAll: manipulating nodes

馋奶兔 提交于 2019-12-05 03:28:39
As far as I have understood, querySelector returns a real changeable element while querySelectorAll returns a non-live Static Node Set. I want to adjust the style of all elements fitting to a specific selector. It works fine for the first element with querySelector , but not for all matching elements with querySelectorAll . I guess that's because the node set is non-live. Is there a workaround? Or am I missing something? The problem is that querySelector returns a single node. querySelectorAll returns a set of nodes (the live-ness means the elements in the set won't be removed if you update

XSL msxsl:node-set problem

情到浓时终转凉″ 提交于 2019-12-01 17:36:01
问题 Please help me out guys. I'm just trying to declare a simple result tree fragment and iterate over it. ... <xsl:variable name="rtf"> <item-list> <item id="1">one</item> <item id="2">two</item> <item id="3">three</item> <item id="4">four</item> </item-list> </xsl:variable> <xsl:for-each select="msxsl:node-set($rtf)/item-list/item"> <xsl:value-of select="@id"/> </xsl:for-each> ... Am I completely mistaken about how this works? Edit: I'm using .NET XslCompiledTransform and have the correct msxsl

build node-set variable from result tree fragment using <xsl:choose>

℡╲_俬逩灬. 提交于 2019-11-29 17:22:55
Is it possible to create a node-set variable from an rtf using xsl:choose (for use in MSXML engine)? I have the following construct: <xsl:choose> <xsl:when test="function-available('msxsl:node-set')"> <xsl:variable name="colorList" select="msxsl:node-set($std:colorList)"/> <xsl:for-each select="$colorList/color"> tr.testid<xsl:value-of select="@testid"/> { color:<xsl:value-of select="."/>; } </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:variable name="colorList" select="$std:colorList"/> <xsl:for-each select="$colorList/color"> tr.testid<xsl:value-of select="@testid"/> { color:<xsl:value-of

How can make an XSLT Javascript extension function return a node-set?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 14:09:27
Is there a simple way to have an extension function in XSLT 1.0 written in javascript return a node-set? I could create a new java class for this, but I would rather just put some code in the script itself. When this can be done in another scripting language supported by all or most XSLT processors (VB script? Groovy? C#?), then that's OK too of course. I have the following simple script: <msxsl:script language="JScript" implements-prefix="custom"> function xml (input) { var x = input.split(";"); return x.toString(); } </msxsl:script> which returns a string, and hence no problem calling the