xslt

How to replace namespace prefix in element and attributes using xslt

人盡茶涼 提交于 2021-01-20 07:13:57
问题 I have a source xml like following: <SampleRequest xmlns="http://sample.com/s" xmlns:s1="http://sample.com/s1" xmlns:s2="http://sample.com/s2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sample.com/s schema.xsd"> <data> <s1:customer s1:firstName="Jim" s1:lastName="Ellison"/> <s2:address> 123 test street </s2:address> </data> </SampleRequest> I need to transform it to the following <SampleRequest xmlns="http://sample.com/t" xmlns:t1="http://sample.com/t1"

How to replace namespace prefix in element and attributes using xslt

放肆的年华 提交于 2021-01-20 07:13:35
问题 I have a source xml like following: <SampleRequest xmlns="http://sample.com/s" xmlns:s1="http://sample.com/s1" xmlns:s2="http://sample.com/s2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://sample.com/s schema.xsd"> <data> <s1:customer s1:firstName="Jim" s1:lastName="Ellison"/> <s2:address> 123 test street </s2:address> </data> </SampleRequest> I need to transform it to the following <SampleRequest xmlns="http://sample.com/t" xmlns:t1="http://sample.com/t1"

XSL-FO fo:repeatable-page-master-alternatives not working properly

╄→尐↘猪︶ㄣ 提交于 2021-01-20 06:58:06
问题 I want to add the page number in footer if the number of pages is more than one, but not for if there is only one page. I tried the following code but it shows the page number in all cases : <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="singlePage" page-height="800pt" page-width="612pt" margin-top="0pt" margin-bottom="46pt" margin-left="26pt" margin-right="26pt"> <fo:region-body margin-top="110pt" margin-bottom="65pt" /> <fo

Combine XSLT and regex to find strings

心不动则不痛 提交于 2021-01-07 03:11:43
问题 I'm trying to find a way identify specific strings, punctuation, and similar in XML files, where those strings must sometimes appear within specific elements and sometimes not in specific elements. IOW I sometimes want to ignore <command> or <screen> or other elements. Sample source XML: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ <!ENTITY % common_entities SYSTEM "../../..

Combine XSLT and regex to find strings

旧时模样 提交于 2021-01-07 03:10:48
问题 I'm trying to find a way identify specific strings, punctuation, and similar in XML files, where those strings must sometimes appear within specific elements and sometimes not in specific elements. IOW I sometimes want to ignore <command> or <screen> or other elements. Sample source XML: <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ <!ENTITY % common_entities SYSTEM "../../..

Remove certain nodes from an xml using xslt3.0

女生的网名这么多〃 提交于 2021-01-07 02:33:00
问题 Currently i am trying to remove certain nodes from an xml using xslt3.0 using identity template. But this is taking long processing time. need some suggestion to improve performace using Xslt30Transformer. <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/"> <xsl:output method="xml" indent="yes"/> <xsl:variable name="pathexcluded" select="'CATALOG/CD1 | CATALOG/CD2 '"/> <xsl:variable name="changed-nodes" as="node()*" > <xsl

Remove certain nodes from an xml using xslt3.0

跟風遠走 提交于 2021-01-07 02:32:58
问题 Currently i am trying to remove certain nodes from an xml using xslt3.0 using identity template. But this is taking long processing time. need some suggestion to improve performace using Xslt30Transformer. <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/"> <xsl:output method="xml" indent="yes"/> <xsl:variable name="pathexcluded" select="'CATALOG/CD1 | CATALOG/CD2 '"/> <xsl:variable name="changed-nodes" as="node()*" > <xsl

converting date from a timezone to UTC XSLT 1.0

杀马特。学长 韩版系。学妹 提交于 2021-01-07 01:28:58
问题 How can I format the below XML date element in XSLT version1.0 ? The GenerationTime has to be formatted in pattern yyyy-MM-dd'T'HH:mm:ss in the output XML with the date value in UTC . xslt processer used is xalan <Values> <value name="cardGenerated">yes</value> <value name="GenerationTime">Tue Dec 29 14:32:53 EST 2020</value> <Values> the output would look like <Values> <value name="cardGenerated">yes</value> <value name="GenerationTime">2020-12-19T19:32:53Z</value> <Values> 来源: https:/

converting date from a timezone to UTC XSLT 1.0

戏子无情 提交于 2021-01-07 01:23:56
问题 How can I format the below XML date element in XSLT version1.0 ? The GenerationTime has to be formatted in pattern yyyy-MM-dd'T'HH:mm:ss in the output XML with the date value in UTC . xslt processer used is xalan <Values> <value name="cardGenerated">yes</value> <value name="GenerationTime">Tue Dec 29 14:32:53 EST 2020</value> <Values> the output would look like <Values> <value name="cardGenerated">yes</value> <value name="GenerationTime">2020-12-19T19:32:53Z</value> <Values> 来源: https:/

converting date from a timezone to UTC XSLT 1.0

你离开我真会死。 提交于 2021-01-07 01:23:18
问题 How can I format the below XML date element in XSLT version1.0 ? The GenerationTime has to be formatted in pattern yyyy-MM-dd'T'HH:mm:ss in the output XML with the date value in UTC . xslt processer used is xalan <Values> <value name="cardGenerated">yes</value> <value name="GenerationTime">Tue Dec 29 14:32:53 EST 2020</value> <Values> the output would look like <Values> <value name="cardGenerated">yes</value> <value name="GenerationTime">2020-12-19T19:32:53Z</value> <Values> 来源: https:/