I am transforming a idml file into a xml in my project.I have an issue on extra xml declaration. Here is the part of idml file :`
<Content> <?xml version="1.0" encoding="UTF-16"
standalone="yes"?>
<math>
</math></Content>
` This is the output I am getting after transformation:
<?xml version="1.0" encoding="UTF-8"?>
<content>
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<math></math>
</content>
My task is to replace <
and >
with < and >,then I got this issue..
I tried lots of ways to do this(not standard things)..Finally I tried to replace word xml replace with space and convert this to PI and transform PI in post processing mode..but it also was not succeeded
<xsl:template match="Content">
<xsl:if test=".[contains(text(),'math')]">
<xsl:value-of select="replace(./text(),'xml','')”/>
</xsl:if>
</xsl:template>
Output I want to generate:
<?xml version="1.0" encoding="UTF-8"?> <content><math></math></content>
And I am using Saxon 9.7.0HE for my development.
Please help me to solve this issue..Thank you..!
I know it's an old question, but people who stumble upon it might still like to see an answer that applies to a
version="1.0"
stylesheet. So here's a solution that works by simply removing the first line / XML declaration: