You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sam <sa...@rediffmail.com> on 2004/05/11 20:48:38 UTC

Displaying XML document as it is ??

Hello ppl,

I would like to know the best practice to display a simple XML document as it is on the browser. say I have an XML document called vector.xml which looks like:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE class SYSTEM "collection.dtd">
<class>
    <info>			
		public class Vector
	        extends AbstractList
		implements List, RandomAccess, Cloneable, Serializable
		
		The Vector class implements a growable array of 
                objects. Like an array, it contains components that can
                be accessed using an integer index. However, the size 
                of a Vector can grow or shrink as needed to accommodate
                adding and removing items after the Vector has been 
                created.
    </info>
</class>

====================================================================

What would be the best practice to display the contents of <info> element on the browser as it is without disturbing the allignments, linebreaks etc etc ...

In other words just display it as it looks inside the <info> element.

Any body ....

sam

Re: Displaying XML document as it is ??

Posted by la...@marinepower.com.
Or serialize it with xml ...

 <map:match pattern="get-xml">
 <map:generate src="path/to/your/document.xml"/>
 <map:serialize type="xml"/>
                                                 </map:match>





gounis@osmosis.gr
11/05/2004 21:11
Please respond to users
 
        To:     users@cocoon.apache.org, Sam <sa...@rediffmail.com>
        cc: 
        Subject:        Re: Displaying XML document as it is ??



if your client is IE then just call a pipeline that serialize content as 
xml otherwise use xml2html.xslt 


                                                 <map:match 
pattern="get-xml">
 <map:generate src="path/to/your/document.xml"/>
 <map:transform src="path/to/xml2html.xslt"/>
 <map:serialize type="html"/>
                                                 </map:match>


you can found xml2html.xslt in cocoon distr.
(stylesheets/system/)

--stavros

On 11 May 2004, Sam wrote:

> Hello ppl,

I would like to know the best practice to display a simple XML document as 
it is on the browser. say I have an XML document called vector.xml which 
looks like:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE class SYSTEM "collection.dtd">
<class>
    <info> 
                                 public class Vector
                         extends AbstractList
                                 implements List, RandomAccess, Cloneable, 
Serializable
 
                                 The Vector class implements a growable 
array of 
                objects. Like an array, it contains components that can
                be accessed using an integer index. However, the size 
                of a Vector can grow or shrink as needed to accommodate
                adding and removing items after the Vector has been 
                created.
    </info>
</class>

====================================================================

What would be the best practice to display the contents of <info> element 
on the browser as it is without disturbing the allignments, linebreaks etc 
etc ...

In other words just display it as it looks inside the <info> element.

Any body ....

sam


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



Re: Displaying XML document as it is ??

Posted by go...@osmosis.gr.
if your client is IE then just call a pipeline that serialize content as 
xml otherwise use xml2html.xslt 


			<map:match pattern="get-xml">
				<map:generate src="path/to/your/document.xml"/>
				<map:transform src="path/to/xml2html.xslt"/>
				<map:serialize type="html"/>
			</map:match>


you can found xml2html.xslt in cocoon distr.
(stylesheets/system/)

--stavros

On 11 May 2004, Sam wrote:

> Hello ppl,

I would like to know the best practice to display a simple XML document as it is on the browser. say I have an XML document called vector.xml which looks like:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE class SYSTEM "collection.dtd">
<class>
    <info>			
		public class Vector
	        extends AbstractList
		implements List, RandomAccess, Cloneable, Serializable
		
		The Vector class implements a growable array of 
                objects. Like an array, it contains components that can
                be accessed using an integer index. However, the size 
                of a Vector can grow or shrink as needed to accommodate
                adding and removing items after the Vector has been 
                created.
    </info>
</class>

====================================================================

What would be the best practice to display the contents of <info> element on the browser as it is without disturbing the allignments, linebreaks etc etc ...

In other words just display it as it looks inside the <info> element.

Any body ....

sam


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org