xslt-1.0

In XSLT, many to many attributes comparing in for-each condition

青春壹個敷衍的年華 提交于 2019-12-24 07:18:15
问题 Using XSLT 1.0 Is it possible to filter many to many attributes, i mean as below example: "../../../../fieldmap/field[@name" i.e. more then 1 elements as fieldmap containing "field/@name" attribute are exists and it is comparing with definition/@title and there too more then one definition element exists containing @title. EXAMPLE: <xsl:for-each select="../../../../fieldmaps/field[@name=../destination/@title]"> Can you please suggest me how it could possible to achieve -- if field containing

how do i merge multiple xslt files and xml files to input as one another to get the final output?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 05:54:09
问题 I have three xsl files and one input file: -input.xml process1.xsl output1.xml -output1.xml process2.xsl output3.xml now i want to just have it as: input.xml process.xslt output.xml process1.xsl, process2.xsl and their outputs should passed as the input to the xsl file and generate output.xml in the same process.xsl file. how do i do this in xslt , i have referred to xslt apply imports but i am not getting proper reference for assigning the xml output as input for another xsl file all in one

Splitting of strings based on the required length

天涯浪子 提交于 2019-12-24 05:46:31
问题 Is there an easy way on how to split a string based from the required length? For example, I have a string: <Data>AAAAABBBBB1111122222RRRRR<Data> and I want to populate an output like this: AAAAA BBBBB 11111 22222 RRRRR Thank you. 回答1: You can use analyze-string to break up the data: <xsl:template match="Data"> <xsl:variable name="tokens" as="xs:string*"> <xsl:analyze-string select="." regex=".{{1,5}}"> <xsl:matching-substring> <xsl:sequence select="."/> </xsl:matching-substring> </xsl

Unanticipated <xsl:apply-imports/> behavior

人走茶凉 提交于 2019-12-24 04:30:14
问题 I've been trying to figure out how to best modularize my XSLT stylesheets to facilitate re-use. I hit upon the idea of using <xsl:apply-imports/> as a way of introducing document-specific attributes to standard tag transformations. This is not working the way I expected it would, and I can't even begin to fathom what is going on here. Here is a simplified version of the stylesheet: <!-- main.xsl --> <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3

How to mention namespace in XSLT file when the namespaces are dynamic?

こ雲淡風輕ζ 提交于 2019-12-24 03:55:22
问题 I have a requirement to store XML data in DB and after that retrieve xml from DB and convert to PDF. For that I am using XSLT with Apache FOP. The below code is working fine with current namespaces in the XML file(I have copied and pasted the namespaces from Books.xml file to Books.xsl . The Problem is whenever the WebService is updated if the namespace of Books.xml file is changed then my Books.xsl file with old namespaces is giving exception while generating PDF using Apache FOP. Note : If

don't want xslt intepret the entity characters

巧了我就是萌 提交于 2019-12-24 03:28:17
问题 The xml was like this: < cell i='0' j='0' vi='0' parity='Odd' subType='-1'> & #34;String& #39;</cell> But after the intepretion of the xsl, the output is like this: < td nowrap="true" class="gridCell" i="0" j="0">"String'< /td> I would like to keep the & #34; and & #39;. I've tried character map,but it doesn't work. The code is like this: < xsl:character-map name="raquo.ent"> <xsl:output-character character="'" string="&apos;"/> <xsl:output-character character="'" string="&apos;"/> < /xsl

XSLT escaping >

三世轮回 提交于 2019-12-24 02:54:06
问题 i have a problem like a lot of people with escaping the > sign. the data xml file looks like <XML> <check><![CDATA[value > 60]]></check> </Xml> with xslt i would like to create a c# function. the checks are items that gone be used in a if statement. public void product(int value) { if( <xsl:value-of disable-output-escaping="yes" select="actie" />) this should be: if( value > 60 ) but returns if( value > 60 ) } <xsl:value-of cdata-section-elements="check"/> can't be used becouse i can't use

Display number of pages in Word ML

孤街醉人 提交于 2019-12-24 02:33:12
问题 I want to display total number of pages on the first page of word document, that is formin with WORD ML template. I know how to display current page number and total number of pages in a footer. It looks like: <w:ftr w:type="odd"> <w:p> <w:r wsp:rsidRPr="007924AD"> <w:rPr> <w:rStyle w:val="a6" /> <w:color w:val="777777" /> </w:rPr> <w:instrText> PAGE </w:instrText> </w:r> </w:p> </w:ftr> But how can I display PAGE or NUMPAGES not in a footer but in the body of a page? Is it possible? 回答1: I

XSLT Union of two input xml documents [closed]

喜欢而已 提交于 2019-12-24 02:22:33
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I want to merge two xml documents. $input(Doc A) contains all the possible elements. Main Source(doc B) may or may not contain all the elements Doc B contains repeatable elements. O/P should be a UNION of both documents. $input (simplified) <StudentData> <Header> <Info></Info> <

Set a Default value for each empty XML tags in XSLT 1.0

心不动则不痛 提交于 2019-12-24 01:57:12
问题 I need to write a default text or number to an empty XML tag using XSLT 1.0, then upon searching here in StackOverflow I happen to look at the solution of Dimitre in this post What I need is for example I have a tag like below: <Number></Number> <!--Which is empty--> or <Text></Text> <!--Which is also empty--> What I need is to put a Default value for each empty tags in my XML like <Number>0.00</Number> for numeric tags and <Text>nil</Text> for Alphanumeric tags, I have quite a big XML so is