Re: Same Indent in converted output xml

"Martin Honnen [email protected]" <[email protected]> Thu, 15 Apr 2021 06:38:19 -0000
Newsgroups gmane.text.xml.xsl.general.mulberrytech
Message-ID <[email protected]>
Am 15.04.2021 um 06:32 schrieb Byomokesh Sahoo [email protected]:
> Hi,
>
> Any way to same indentation=C2=A0will appear while converting One XML to
> Another XML format. I am using indent=3D"yes" but the same indent does not
> appear in converted output xml.
>
> I can not use xsl:copy because I have to apply one format to another
> format with different scenarios.
>
> _XSL:_
>
> <xsl:output indent=3D"yes" method=3D"xml" />
>
> _INPUT:_
> <journal-meta>
> <journal-id journal-id-type=3D"publisher-id">ier</journal-id>
> <journal-id journal-id-type=3D"publisher-acronym">IERO</journal-id>
> <journal-title-group>
> <journal-title>Expert</journal-title>
> </journal-title-group>
> <issn publication-format=3D"print">159</issn>
> </journal-meta>
>
> _OUTPUT:_
>  =C2=A0 =C2=A0 =C2=A0 <journal-meta>
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<journal-id journal-id-type=3D"CAT">IE=
RO</journal-id>
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<journal-id journal-id-type=3D"publish=
er">IERO</journal-id>
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<journal-title-group>
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <journal-title>Expert</journal=
-title>
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</journal-title-group>
>  =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<issn publication-format=3D"print">159=
</issn>
>  =C2=A0 =C2=A0 =C2=A0 </journal-meta>
>
> EXPECTED OUTPUT:
>
> <journal-meta>
> <journal-id journal-id-type=3D"publisher-id">ier</journal-id>
> <journal-id journal-id-type=3D"publisher-acronym">IERO</journal-id>
> <journal-title-group>
> <journal-title>Expert</journal-title>
> </journal-title-group>
> <issn publication-format=3D"print">159</issn>
> </journal-meta>

So you just want line breaks but no indentation? I think Saxon PE and EE
have an extension attribute on xsl:output you can set. Which XSLT
processor do you use?
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/3329386
or by email: [email protected]
--~--