Re: [xsl] Group various elements with empty tags (flat XML structure to hierarcial XML)

Subject: Re: [xsl] Group various elements with empty tags (flat XML structure to hierarcial XML)
From: António Mota <amsmota@xxxxxxxxx>
Date: Fri, 7 Jan 2005 18:55:21 +0000
For the first i suppose you should use

extension-element-prefixes ="sql" on the stylesheet declaration.


On Fri, 07 Jan 2005 13:45:53 -0500, M Glenties <mglenties@xxxxxxxxxxx> wrote:
> Thank you everyone for your posts.
>
> The solution from Charles Knell is close to what I need. The output has 2
> problems:
>
> 1. The attribute xmlns:sql="urn:schemas-microsoft-com:xml-sql" is now
> included with each element.
> (FYI, the flat xml document I start with is created from an sql "for xml
> auto" command in a template file launched by VB).
>
> 2. The data grouped in the new tags repeats after the tag (except for the
> first element in the group).
>
> For example, (snippet):
> -------------------------------------
> <ADDRESS>
>      <street xmlns:sql="urn:schemas-microsoft-com:xml-sql">35 Main
> Street</street>
>      <city xmlns:sql="urn:schemas-microsoft-com:xml-sql">Moosejaw</city>
>      <country
> xmlns:sql="urn:schemas-microsoft-com:xml-sql"y>Saskatchewan</country>
>      <postal_code
> xmlns:sql="urn:schemas-microsoft-com:xml-sql">TOEOPO</postal_code>
> </ADDRESS>
> MoosejawSaskatchewanTOEOPO
> ------------------------------------
>
>
> To clear up Antsnio's question, the following is needed as David said:
>
> <xsl:template match="id|type|count|language">
>     <xsl:copy-of select="." />
> </xsl:template>
>
> but,
>
> the following does not produce output:
> <xsl:template
> match="initial|lastname|city|country|postal_code|amount1|amount2|amount3"
/>
>
> M Glenties.
>
> >From: David Carlisle <davidc@xxxxxxxxx>
> >Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> >To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> >Subject: Re: [xsl] Group various elements with empty tags (flat XML
> >structure to hierarcial XML)
> >Date: Fri, 7 Jan 2005 14:29:18 GMT
> >
> > > Yes, but isn4t that the default template beahviour?
> >
> >No, the default templates never produce elements in the result, they
> >just recursively process the children meaning that a stylesheet with no
> >templates will extract all the text content of an xml file, discarding
> >any element markup.
> >
> >David
> >
> >________________________________________________________________________
> >This e-mail has been scanned for all viruses by Star. The
> >service is powered by MessageLabs. For more information on a proactive
> >anti-virus service working around the clock, around the globe, visit:
> >http://www.star.net.uk
> >________________________________________________________________________
> >
>
> _________________________________________________________________
> Powerful Parental Controls Let your child discover the best the Internet
has
> to offer.
>
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http
://hotmail.com/enca&HL=Market_MSNIS_Taglines
>   Start enjoying all the benefits of MSN. Premium right now and get the
> first two months FREE*.

Current Thread