xslt

coldfusion xml menu

拟墨画扇 提交于 2020-01-14 04:15:37
问题 I am working to build a menu in coldfusion based on xml. current working function: <cffunction name="xmlNav" access="private" returntype="struct" output="false"> <cfargument name="qGetNav" type="query" required="true"> <cfscript> var qNav=Arguments.qGetNav; var xmlNav=StructNew(); var myXmlDoc=xmlNew(); var route=''; myXmlDoc.XMLRoot = XMLElemNew(myXmlDoc,"UL"); myXmlDoc.UL.xmlAttributes.ID="nav-main-links"; for(q=1;q<=qNav.recordCount;q++){ //setup li myXmlDoc.UL.XmlChildren[q]=XmlElemNew

Convert Ant build file to Makefile

馋奶兔 提交于 2020-01-14 04:07:33
问题 I have Ant build file which is used in Docbook. Now I am going to convert that Ant build file to a Makefile which uses Xsltproc processor. I am not particularly familiar with either Makefile or Ant. So please help me to convert it. Are there any resources which I should follow? Here I want to, 1. copy folder structure and its content into another folder 2. configure java system properties 3. configure classpath In ant script, it has code like this, <copy todir="${output-dir}"> <fileset dir="$

Rename Element and retain attributes

霸气de小男生 提交于 2020-01-14 03:01:45
问题 I would like to rename the mattext node to text, but retain its attributes and all the child node/attributes Input XML <material> <mattext fontface="Tahoma"> <p style="white-space: pre-wrap"> <font size="11">Why are the astronauts in the video wearing special suits? (Select two)</font> </p> </mattext> </material> Output <material> <text fontface="Tahoma"> <p style="white-space: pre-wrap"> <font size="11">Why are the astronauts in the video wearing special suits? (Select two)</font> </p> <

Generic XML to CSV conversion [closed]

本小妞迷上赌 提交于 2020-01-14 03:01:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am trying to convert a dynamic XML to CSV. I searched for various options to achieve this but did not find a suitable answer. The structure of the XML is dynamic - It can be a product data, a geography data or any such thing. So, I am not able to use predefined XSL or castor conversion. The tag names should

XSLT: CSV (or Flat File, or Plain Text) to XML

痴心易碎 提交于 2020-01-13 19:00:48
问题 I am trying to convert plain text files to XML files using XSLT. I started with CSV files, because that is a well-known file format that I could start Googling examples on. I stumbled onto this: http://ajwelch.blogspot.com/2007/02/csv-to-xml-converter-in-xslt-20.html, which also points at http://andrewjwelch.com/code/xslt/csv/csv-to-xml_v2.html. Those links contain what is, supposedly, an XSLT (2.0) that can take a CSV file and convert it to an XML file. ...Except it doesn't actually work. I

Converting HTML to XML using XSLT

假如想象 提交于 2020-01-13 13:53:11
问题 I'm trying to convert an XHTML document to XML using XSLT but I'm currently having trouble getting my templates to match the tags in the input document. Should I be able to convert XHTML to XML like this? If so is there an error in my stylesheet? Input Document: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>title text</title> </head> <body> <p>body text</p> </body> </html> Stylesheet: <?xml version="1.0" encoding="UTF-8"?> <xsl

XSLT every nth node with a filter

走远了吗. 提交于 2020-01-13 13:07:14
问题 I'm using XSLT for some output formatting, and I want a wrapper element around every N nodes of the output. I've read xslt - adding </tr><tr> every n node?, but my problem is that the source nodes have to come from a lookup: <xsl:for-each select="key('items-by-product', $productid)"> rather than just a template match. All the examples I've found assume that the nodes you want are all next to each other, and they're just counting siblings. I have a solution that works for me: <xsl:stylesheet

XSLT1.0/XPath 1.0 Selecting nodes by date range. Is this even possible?

♀尐吖头ヾ 提交于 2020-01-13 09:55:55
问题 Lets say I have a list of nodes that contain an attribute datetime, and I want to select only the records that occur after $compare-datetime. <records> <record @datetime="2010-01-04T16:48:15.501-05:00"/> <record @datetime="2010-01-03T16:48:15.501-05:00"/> ...etc... </records> In xquery to select items within a date range I would do /records/record[xs:dateTime(@datetime) > xs:dateTime($compare-datetime)] However in XSLT 1.0 I have tried alot of different approaches and alot of searching for

using parentheses in xpath/xslt

梦想与她 提交于 2020-01-13 08:06:48
问题 I'm trying to use parentheses to override default operator precedence in an xpath expression within an xslt with no luck. For example: <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl" version="1.0"> <xsl:output encoding="utf-8" standalone="yes"/> <xsl:template match="/"> <xsl:apply-templates select="*"/> </xsl:template> <xsl:template match="@* | node()"> <xsl:copy>

Removing Double Quotes from JSON String [closed]

你。 提交于 2020-01-13 07:29:28
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am taking an xml file that looks like this <FCDMC><rpt_info created="data generated 04/16/2013 16:45"/><gage_rain id="770" last_rpt=