Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: XML -- in dire need of assistance

Re: XML -- in dire need of assistance

From: Henning Follmann <H.Follmann_at_gmx.de>
Date: 17 Jan 2002 08:59:23 -0500
Message-ID: <87ita1ulhg.fsf@mobile.itcfollmann.com>

I suggest to use XSLT to transform your primarely output. (Sorry offtopic)



<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">

<xsl:output method="xml"/>

<xsl:template match="/">

    <xsl:apply-templates select="Person"/>
</xsl:template>

<xsl:template match="Person">

    <Person>

      <Name>
        <xsl:value-of select="./Name"/>
      </Name>
        <xsl:apply-template select="Address"/>
    </Person>
</xsl:template>

<xsl:template match="Address">

    <Address>

      <Street>
        <xsl:value-of select="./Address_item/Street"/>
      </Street>
      <City>
        <xsl:value-of select="./Address_item/City"/>
      </City>

    </Address>
</xsl:template>

</xsl:stylesheet>


Cheers,
Henning

"Sam Baum" <sjb_at_comcast.net> writes:

> I'm using the DBMS_XMLQuery PL/SQL functions to produce an XML document from
> my relational tables, using an object view.  As far as I can tell,
> everything is working as advertised.  However, I have one problem that I
> just can't resolve and any insight would be most appreciated.
> 
> The output of the XML document looks like this:
> 
> <Person>
>     <Name>Bob</Name>
>     <Address>
>         <Address_item>
>             <Street>123 Mystreet</Street>
>             <City>My City</City>
>         </Address_item>
>         <Address_item>
>             <Street>456 Mystreet</Street>
>             <City>My City</City>
>         </Address_item>
>     </Address>
> </Person>
> 
> The problem is the DTD requires me to repeat the Address element and drop
> the Address_item element.  The correct output needs to look like this:
> 
> <Person>
>     <Name>Bob</Name>
>         <Address>
>             <Street>123 Mystreet</Street>
>             <City>My City</City>
>         </Address>
>         <Address>
>             <Street>456 Mystreet</Street>
>             <City>My City</City>
>         </Address>
> </Person>
> 
> I am at a complete loss.  Does anyone know who to get Oracle to do this?
> 
> Thanks in advance for your help.
> 
> Sam Baum
> 
> 
> 
> 

-- 
Henning Follmann          |   H.Follmann_at_gmx.de
8 Jane Road               |  (+1)(908) 464 8972
New Providence, NJ 07974  |                 USA


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!  Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==----- Received on Thu Jan 17 2002 - 07:59:23 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US