Re: Same Indent in converted output xml

"Michael Kay [email protected]" <[email protected]> Wed, 21 Apr 2021 07:05:17 -0000
Newsgroups gmane.text.xml.xsl.general.mulberrytech
Message-ID <[email protected]>
--Apple-Mail=_6B30BBE2-9369-4807-84FB-B6F20793B140
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Saxon-HE does not have an option to produce this format. With Saxon-PE and =
higher you can set saxon:indent-spaces=3D"0".

However, you can of course preserve all the whitespace in the input documen=
t and copy it manually to the output: in fact, that's the default action if=
 you don't use xsl:strip-space, and if you use the default xsl:apply-templa=
tes instruction.

Michael Kay
Saxonica

> On 21 Apr 2021, at 06:11, Byomokesh Sahoo [email protected] <xsl-=
[email protected]> wrote:
>=20
> I am using saxon9he
>=20
> On Thu, Apr 15, 2021 at 10:01 AM Byomokesh Sahoo <[email protected]=
om <mailto:[email protected]>> wrote:
> Hi,
>=20
> Any way to same indentation will appear while converting One XML to Anoth=
er XML format. I am using indent=3D"yes" but the same indent does not appea=
r in converted output xml.
>=20
> I can not use xsl:copy because I have to apply one format to another form=
at with different scenarios.=20=20
>=20
> XSL:
>=20
> <xsl:output indent=3D"yes" method=3D"xml" />
>=20
> 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>
>=20
> OUTPUT:
>       <journal-meta>
>          <journal-id journal-id-type=3D"CAT">IERO</journal-id>
>          <journal-id journal-id-type=3D"publisher">IERO</journal-id>
>          <journal-title-group>
>             <journal-title>Expert</journal-title>
>          </journal-title-group>
>          <issn publication-format=3D"print">159</issn>
>       </journal-meta>
>=20
> EXPECTED OUTPUT:
>=20
> <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>
>=20
> Thanks
> Byomokesh
>=20
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/293509> (by=
 email <>)
--~----------------------------------------------------------------
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]
--~--

--Apple-Mail=_6B30BBE2-9369-4807-84FB-B6F20793B140
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3Dus-ascii"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode=
: space; line-break: after-white-space;" class=3D"">Saxon-HE does not have =
an option to produce this format. With Saxon-PE and higher you can set saxo=
n:indent-spaces=3D"0".<div class=3D""><br class=3D""></div><div class=3D"">=
However, you can of course preserve all the whitespace in the input documen=
t and copy it manually to the output: in fact, that's the default action if=
 you don't use xsl:strip-space, and if you use the default xsl:apply-templa=
tes instruction.<br class=3D""><div class=3D""><br class=3D""></div><div cl=
ass=3D"">Michael Kay</div><div class=3D"">Saxonica<br class=3D""><div><br c=
lass=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">On 21 Apr 20=
21, at 06:11, Byomokesh Sahoo <a href=3D"mailto:[email protected]" =
class=3D"">[email protected]</a> &lt;<a href=3D"mailto:xsl-list-ser=
[email protected]" class=3D"">[email protected]=
.com</a>&gt; wrote:</div><br class=3D"Apple-interchange-newline"><div class=
=3D""><div dir=3D"ltr" class=3D""><div dir=3D"ltr" class=3D"">I am using&nb=
sp;saxon9he</div><br class=3D""><div class=3D"gmail_quote"><div dir=3D"ltr"=
 class=3D"gmail_attr">On Thu, Apr 15, 2021 at 10:01 AM Byomokesh Sahoo &lt;=
<a href=3D"mailto:[email protected]" class=3D"">sahoo.byomokesh@gma=
il.com</a>&gt; wrote:<br class=3D""></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex"><div dir=3D"ltr" class=3D"">Hi,<div class=3D""><br class=
=3D""></div><div class=3D"">Any way to same indentation&nbsp;will appear wh=
ile converting One XML to Another XML format. I am using indent=3D"yes" but=
 the same indent does not appear in converted output xml.</div><div class=
=3D""><br class=3D""></div><div class=3D"">I can not use xsl:copy because I=
 have to apply one format to another format with different scenarios.&nbsp;=
&nbsp;<br class=3D""></div><div class=3D""><br class=3D""></div><div class=
=3D""><u class=3D"">XSL:</u></div><div class=3D""><br class=3D""></div><div=
 class=3D"">&lt;xsl:output indent=3D"yes" method=3D"xml" /&gt;<br class=3D"=
"></div><div class=3D""><br class=3D""></div><div class=3D""><u class=3D"">=
INPUT:</u></div><div class=3D"">&lt;journal-meta&gt;<br class=3D"">&lt;jour=
nal-id journal-id-type=3D"publisher-id"&gt;ier&lt;/journal-id&gt;<br class=
=3D"">&lt;journal-id journal-id-type=3D"publisher-acronym"&gt;IERO&lt;/jour=
nal-id&gt;<br class=3D"">&lt;journal-title-group&gt;<br class=3D"">&lt;jour=
nal-title&gt;Expert&lt;/journal-title&gt;<br class=3D"">&lt;/journal-title-=
group&gt;<br class=3D"">&lt;issn publication-format=3D"print"&gt;159&lt;/is=
sn&gt;<br class=3D"">&lt;/journal-meta&gt;<br class=3D""></div><div class=
=3D""><br class=3D""></div><div class=3D""><u class=3D"">OUTPUT:</u></div><=
div class=3D"">&nbsp; &nbsp; &nbsp; &lt;journal-meta&gt;<br class=3D"">&nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp;&lt;journal-id journal-id-type=3D"CAT"&gt;IER=
O&lt;/journal-id&gt;<br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;jo=
urnal-id journal-id-type=3D"publisher"&gt;IERO&lt;/journal-id&gt;<br class=
=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;journal-title-group&gt;<br clas=
s=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;journal-title&gt;Exper=
t&lt;/journal-title&gt;<br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt=
;/journal-title-group&gt;<br class=3D"">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&=
lt;issn publication-format=3D"print"&gt;159&lt;/issn&gt;<br class=3D"">&nbs=
p; &nbsp; &nbsp; &lt;/journal-meta&gt;<br class=3D""></div><div class=3D"">=
<br class=3D""></div><div class=3D"">EXPECTED OUTPUT:</div><div class=3D"">=
<br class=3D""></div><div class=3D"">&lt;journal-meta&gt;<br class=3D""></d=
iv><div class=3D"">&lt;journal-id journal-id-type=3D"publisher-id"&gt;ier&l=
t;/journal-id&gt;<br class=3D"">&lt;journal-id journal-id-type=3D"publisher=
-acronym"&gt;IERO&lt;/journal-id&gt;<br class=3D"">&lt;journal-title-group&=
gt;<br class=3D"">&lt;journal-title&gt;Expert&lt;/journal-title&gt;<br clas=
s=3D"">&lt;/journal-title-group&gt;<br class=3D"">&lt;issn publication-form=
at=3D"print"&gt;159&lt;/issn&gt;<br class=3D"">&lt;/journal-meta&gt;<br cla=
ss=3D""></div><div class=3D""></div><div class=3D""><br class=3D""></div><d=
iv class=3D"">Thanks</div><div class=3D"">Byomokesh</div><div class=3D""><b=
r class=3D""></div></div>
</blockquote></div></div>
<div class=3D""><!-- begin bl.html.trailer -->
<div style=3D"border-top:1px solid black; background-color: #dddddd;
color: #888888; font-size: smaller; padding: 5px; text-align: center;
font-family: arial,verdana,arial,sans-serif; margin-top:1em; clear:
both; margin: auto" class=3D"">
<a href=3D"http://www.mulberrytech.com/xsl/xsl-list" class=3D"">
XSL-List info and archive</a>
<div style=3D"text-align:center;" class=3D"">
<a style=3D"color: blue;" href=3D"http://lists.mulberrytech.com/unsub/xsl-l=
ist/293509" class=3D"">EasyUnsubscribe</a>
(<a style=3D"color: blue;" href=3D"" class=3D"">by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>
</div></blockquote></div><br class=3D""></div></div></body></html>
<div><!-- begin bl.html.trailer -->
<div style=3D"border-top:1px solid black; background-color: #dddddd;
color: #888888; font-size: smaller; padding: 5px; text-align: center;
font-family: arial,verdana,arial,sans-serif; margin-top:1em; clear:
both; margin: auto">
<a href=3D"http://www.mulberrytech.com/xsl/xsl-list">
XSL-List info and archive</a>
<div style=3D"text-align:center;">
<a style=3D"color: blue;"
  href=3D"http://lists.mulberrytech.com/unsub/xsl-list/3329386"
>EasyUnsubscribe</a>
(<a style=3D"color: blue;"
href=3D"mailto:[email protected]?subject=3Dremove"
>by email</a>)
</div>
</div>
<!-- end bl.html.trailer --></div>

--Apple-Mail=_6B30BBE2-9369-4807-84FB-B6F20793B140--