[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Adding an element of a specific type

Subject: RE: Adding an element of a specific type
From: "Geert Josten" <geert.josten@xxxxxxxxxxx>
Date: Wed, 18 Oct 2006 16:29:30 +0200
RE:  Adding an element of a specific type
Hi Peter,

How about adding the xsi namespace to the xsl:stylesheet element?

Kind regards,
Geert

>


Drs. G.P.H. Josten
Consultant



Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit
bericht kunnen geen rechten worden ontleend.


> Van: Hofman, Peter [mailto:peter.hofman@xxxxxxxxxxxxx]
> Verzonden: woensdag 18 oktober 2006 15:47
> Aan: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Onderwerp:  Adding an element of a specific type
>
> Hi all,
>
> How do I add an element of a specific type to the output.
>
> This is my input:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ns1:P xmlns:ns1="somenamespace">
>     <ns1:X>some data</ns1:X>
>     <ns1:O>
>         <ns1:C>
>             ...
>         </ns1:C>
>     </ns1:O>
> </ns1:P>
>
> I want to get the structure below. The schema does not have
> element Q, but only has complexType Q_Type:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ns1:Q type="ns1:Q_Type" xmlns:ns1="somenamespace">
>     <ns1:C>
>             ...
>     </ns1:C>
> </ns1:P>
>
> I tried something like this, but that does not seem to work:
>
> <xsl:template match="ns1:O">
>     <xsl:element name="ns1:Q">
>        <xsl:attribute name="xsi:type">ns1:Q_Type</xsl:attribute>
>        <xsl:apply-templates select="ns1:C" >
>     </xsl:element>
> </xsl:template>
>
> The processor starts complaining about the namespace of the
> type, which I kind of expected already.
> Haven't got a clue though how to fix this.
>
> (sorry, but I am not sure which processor I have, since it is
> embedded in an existing application)
>
> Best regards,
> Peter
>
>
> This e-mail and any attachment is for authorised use by the
> intended recipient(s) only. It may contain proprietary
> material, confidential information and/or be subject to legal
> privilege. It should not be copied, disclosed to, retained or
> used by, any other party. If you are not an intended
> recipient then please promptly delete this e-mail and any
> attachment and all copies and inform the sender. Thank you.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.