You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steven Maring <St...@trcinc.com> on 2000/04/07 16:35:09 UTC

outputing XML in XSP logicsheet?

I want to output XML from XSP code like this:

<xsp:logic>
   String myXML = "<message>Hello World</message>";

   <xsp:content>
       <xsp:expr>myXML</xsp:expr>
   </xsp:content>
...


but <xsp:expr> generates a text node so '<' becomes &lt; etc.

How can I do this?


-Steve Maring

Re: DTD and relational database

Posted by guillermo <gu...@teleco.upv.es>.
Hi

I am not sure if this will help you, but have you visit

http://technet.oracle.com/tech/xml/info/index2.htm?Info&htdocs/otnwp/about_oracle_xml_products.htm

Hope it helps

Matthew Cordes schrieb:

> Hello all,
>
> I want to make a generic class that will create an xml document based
> upon rules passed to it and a ResultSet ( data from database ).  For
> instance, perhaps I have the following row in Oracle:
>
> CATEGORY        SUBJECT         NAME            ALIAS
> Art                     Painting        Mr. Smith       smith
>
> and I want to create this xml
>
> <CATEGORY value="Art">
>         <SUBJECT value="Painting">
>                 <PERSON>
>                         <NAME>
>                                 Mr. Smith
>                         </NAME>
>                         <ALIAS>
>                                 smith
>                         </ALIAS>
>                 </PERSON>
>         </SUBJECT>
> </CATEGORY>
>
> I realize that it is pretty easy to go from my row to xml, but I want
> to make something generic enough I can just pass it a ResultSet object
> and some rules and it will spit out the correct xml Document.
>
> Is there a way I can use the DTD to do this?  Or atleast to specify the
> rules?  Also, anyone familiar with Xerces ( Apache's parser ), could you
> tell me how to create a new DTD from within my java code.  This part
> is a litle confusing to me.
>
> Does anyone know of a package that will do this?  (Probably not) In that
> case I'm going to try, any suggestions?
>
> -matt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


DTD and relational database

Posted by Matthew Cordes <mc...@maine.edu>.
Hello all, 

I want to make a generic class that will create an xml document based 
upon rules passed to it and a ResultSet ( data from database ).  For 
instance, perhaps I have the following row in Oracle:

CATEGORY	SUBJECT		NAME		ALIAS
Art			Painting	Mr. Smith	smith

and I want to create this xml

<CATEGORY value="Art">
	<SUBJECT value="Painting">
		<PERSON>
			<NAME>
				Mr. Smith
			</NAME>
			<ALIAS>
				smith
			</ALIAS>
		</PERSON>	
	</SUBJECT>
</CATEGORY>	
	
I realize that it is pretty easy to go from my row to xml, but I want 
to make something generic enough I can just pass it a ResultSet object
and some rules and it will spit out the correct xml Document.

Is there a way I can use the DTD to do this?  Or atleast to specify the 
rules?  Also, anyone familiar with Xerces ( Apache's parser ), could you 
tell me how to create a new DTD from within my java code.  This part 
is a litle confusing to me.

Does anyone know of a package that will do this?  (Probably not) In that
case I'm going to try, any suggestions?

-matt

Re: outputing XML in XSP logicsheet?

Posted by Mike Engelhart <me...@earthtrip.com>.
Steven Maring wrote:

> I want to output XML from XSP code like this:
> 
> <xsp:logic>
> String myXML = "<message>Hello World</message>";
> 
> <xsp:content>
> <xsp:expr>myXML</xsp:expr>
> </xsp:content>
> ...

With XSP you do this:

String myXMLValue = "Hello World";

<xsp:element name="message">
    <xsp:content><xsp:expr>myXMLValue</xsp:expr></xsp:content>
</xsp:element>

or a variation on that like
<message><xsp:expr>myXMLValue</xsp:expr></message>

Why would you want your xml tags to be embedded in the String variable?
That kind of defeats the purpose of using XML/XSL for publishing?