I use an xslt to get some ID attribute..when new xml file is built..
Here is a input xml file..


<page num="App. A-1"/>
<title>Appendix A</title>
<subtitle>The Thompson Memorandum</subtitle>
<para align="left"><content-style font-style="bold">U.S. Department of Justice</content-style></para>
<para>Office of the Deputy Attorney General</para>
<para>The Deputy Attorney General</para>
<para>January 20, 2003</para>
<table frame="none" width="100%">
<tgroup cols="2">
<colspec align="left" colname="col1" colnum="1" colwidth="25"/>
<colspec align="left" colname="col2" colnum="2" colwidth="75"/>
<tbody>
<row>
<entry namest="col1" nameend="col2"><para><content-style format="underline">MEMORANDUM</content-style></para></entry>
</row>
<row>
<entry><para>TO:</para></entry>
<entry><para>Heads of Department Components United States Attorneys</para></entry>
</row>
<row>
<entry><para>FROM:</para></entry>
<entry><para>Larry D. Thompson Deputy Attorney General</para></entry>
</row>
<row>
<entry><para>SUBJECT:</para></entry>
<entry><para><content-style format="underline">Principles of Federal Prosecution of Business Organizations</content-style></para></entry>
</row>
</tbody>
</tgroup>

New XML file is like this..

<page num="App. A-1"/><title>Appendix A</title><subtitle>The Thompson Memorandum</subtitle><para align="left"><content-style font-style="bold">U.S. Department of Justice</content-style></para><para>Office of the Deputy Attorney General</para><para>The Deputy Attorney General</para><para>January 20, 2003</para><table frame="none" width="100%" id="tab_chap_001"><tgroup cols="2"><colspec align="left" colname="col1" colnum="1" colwidth="25"/><colspec align="left" colname="col2" colnum="2" colwidth="75"/><tbody><row><entry namest="col1" nameend="col2"><para><content-style format="underline">MEMORANDUM</content-style></para></entry></row><row><entry><para>TO:</para></entry><entry><para>Heads of Department Components United States Attorneys</para></entry></row><row><entry><para>FROM:</para></entry><entry><para>Larry D. Thompson Deputy Attorney General</para></entry></row><row><entry><para>SUBJECT:</para></entry><entry><para><content-style format="underline">Principles of Federal Prosecution of Business Organizations</content-style></para></entry></row></tbody></tgroup>

I need to get xml file in same format...
It need hard returns..
<xsl:output indent="yes"> give indent file but not the same as input..


Can any one help me???


thanks,
Parth Mishra

Is whitespace in your output document really critical? The output indenting just makes the output tree look pretty by inserting returns and tabs as needed for a tree.

If you really need to insert line break and whitespace in the output tree, you'll need to add them in as part of your transformation.

http://www.dpawson.co.uk/xsl/sect2/N7150.html

Check out this link above. It offers a lot of suggestions about escaped characters and whitespace in XSLT. You should find what you're looking for.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.