xslt

Struggling with XSLT processing of nested elements

≡放荡痞女 提交于 2020-02-08 08:35:01
问题 I am trying to process some XML that has nested elements into HTML where each processed element is within tags so that I can show and hide divs using JavaScript based on the user pressing a Next link. I am having problems because the tag for the parent is being placed after the for the 2 children. This is causing an issue because I cannot hide the parent to show the children. here is the XML snippet I am starting with: <mainProcedure> <proceduralStep id="pstp1"> <para>Some text to display 1<

Struggling with XSLT processing of nested elements

与世无争的帅哥 提交于 2020-02-08 08:33:50
问题 I am trying to process some XML that has nested elements into HTML where each processed element is within tags so that I can show and hide divs using JavaScript based on the user pressing a Next link. I am having problems because the tag for the parent is being placed after the for the 2 children. This is causing an issue because I cannot hide the parent to show the children. here is the XML snippet I am starting with: <mainProcedure> <proceduralStep id="pstp1"> <para>Some text to display 1<

XSLT : I need to parse the xml with same element name with sequence of order to map in to another xml with different name

允我心安 提交于 2020-02-08 06:46:21
问题 As the below source XML Value/string element value has to be replace with target element value, Could some please help me out how to create the XSL to transform from source xml into target xml .Please. Source XML: <PricingResultsV6> <subItems> <SubItem> <profiles> <ProfileValues> <values> <strings>800210</strings> <strings>THC</strings> <strings>10.0</strings> <strings>20.0</strings> <strings>30.0</strings> <strings>40.0</strings> <strings>550.0</strings> <strings>640.0</strings> </values> <

XSLT : I need to parse the xml with same element name with sequence of order to map in to another xml with different name

不羁的心 提交于 2020-02-08 06:46:11
问题 As the below source XML Value/string element value has to be replace with target element value, Could some please help me out how to create the XSL to transform from source xml into target xml .Please. Source XML: <PricingResultsV6> <subItems> <SubItem> <profiles> <ProfileValues> <values> <strings>800210</strings> <strings>THC</strings> <strings>10.0</strings> <strings>20.0</strings> <strings>30.0</strings> <strings>40.0</strings> <strings>550.0</strings> <strings>640.0</strings> </values> <

Change pattern's priority or revise the code?

社会主义新天地 提交于 2020-02-07 02:35:08
问题 Here is a code which, in fact, gives the correct output. But the question is about optimizing internal processes. They, conditionally, can be divided into 2 parts. MAIN algorithm (set of codes which create relation chains) DELETE pattern (removes unnecessary nodes, which do not meet the conditions) Patterns' execution priority as i can rate on tests is 1-[MAIN] then finally 2-[DELETE]. But the thing is, the opposite order 1-[DELETE] then 2-[MAIN] would be, as i guess, a more effective

xsl:preserve-space breaks the rest of the code

…衆ロ難τιáo~ 提交于 2020-02-07 02:01:31
问题 My team uses an XML editor, MadCap Flare, to write technical documentation, with both PDF and HTML outputs. We need to use H2s for some pages to correctly format the PDFs, but for SEO purposes, we need to convert those to H1s for web. I have written a build event that converts H2s to H1s upon web publish. However, I have just realized that the XSL code incorrectly strips spaces from between variables and images. I discovered xsl:preserve-space, but using this breaks the rest of the code so

XSLT 2.0 moving a node (created in first step of a multi-step transformation)

自作多情 提交于 2020-02-06 13:10:02
问题 XML and the XSLT 2.0 files for this question are found at https://xsltfiddle.liberty-development.net/6qVRKwX/3 I am trying to 'move' an element ahead of outputting a section of HTML. This element was created during the first part of the transformation) using @mode to insert footnote numbers into the text. The first mode fn-add-marker creates <fn-marker/> to hold the footnote number. The second mode number then inserts incremented footnote numbers. All of this works fine (through to line 52

XSLT 2.0 moving a node (created in first step of a multi-step transformation)

岁酱吖の 提交于 2020-02-06 13:09:24
问题 XML and the XSLT 2.0 files for this question are found at https://xsltfiddle.liberty-development.net/6qVRKwX/3 I am trying to 'move' an element ahead of outputting a section of HTML. This element was created during the first part of the transformation) using @mode to insert footnote numbers into the text. The first mode fn-add-marker creates <fn-marker/> to hold the footnote number. The second mode number then inserts incremented footnote numbers. All of this works fine (through to line 52

XsltTransform System.Xml.XPath.XPathException: 'Expression must evaluate to a node-set.'

狂风中的少年 提交于 2020-02-06 07:50:34
问题 I`m having problem with my XSLT - Transformation . This is how I create XSLT class XmlUrlResolver resolver = new XmlUrlResolver(); resolver.Credentials = CredentialCache.DefaultCredentials; var xslt = new XslTransform(); xslt.Load(_xslPath, resolver); using (StringReader sr = new StringReader(myXml)) { XPathDocument doc = new XPathDocument(sr); using (var sw = new StringWriter()) { var argList = new XsltArgumentList(); var doc2 = File.ReadAllText("D:\\test\\Doc2.xml"); using (StringReader sr2

How to use for loop in XSLT and get node values based on the iteration

倖福魔咒の 提交于 2020-02-04 05:57:41
问题 How do we use for loop in XSLT? I have this requirement where I want to convert the below shown xml into a comma separated file. Number of rows in CSV file would be equal to count of COBRA_Records_within_Range nodes for an employee's report entry. All values in 3 rows will be same except the child element values for COBRA_Records_within_Range nodes. I am able to create 3 rows but not able to retrieve the value for child elements of COBRA_Records_within_Range . I want to run the for loop on a