Title: Message
Hi Paul,
 
The source generator not saving the prefix in version 0.9.5.2. One way to generate the correct prefix is to add a namespace mapping declaration in the Marshaller.
However I am afraid we might face a bug since Castor is not even declaring the namespace for XLink.
Can you please try the CVS version of Castor as well as declaring the namespace via the Marshaller API? If you still face the problem then I advise you to file a bug in bugzilla (bugzilla.exolab.org).
 
Thanks,

Arnaud
 
 


This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended recipient, dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message and its attachments and notify us immediately.

-----Original Message-----
From: Paul Chu [mailto:[EMAIL PROTECTED]
Sent: Friday, January 09, 2004 9:44 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Namespace Problem with attributeGroup

Dear Developers:

 

     Hi, I am having a problem with an attributeGroup that is declared in a namespace that

is associated with an xsd file.  I am using Castor-0.9.5.2 SourceGenerator with the default

settings to generate the classes from this xsd file:

 

<?xml version="1.0" encoding="UTF-8"?>

<schema targetNamespace="http://www.opengis.net/wms"

        xmlns="http://www.w3.org/2001/XMLSchema"

        xmlns:wms="http://www.opengis.net/wms"

        xmlns:xlink="http://www.w3.org/1999/xlink"

        elementFormDefault="qualified">

 

  <import namespace="http://www.w3.org/1999/xlink"

          schemaLocation="http://schemas.cubewerx.com/schemas/gml/2.1/xlinks.xsd"/>

 

  <element name="TestSample">

    <complexType>

      <sequence>

        <element name="Title" type="string"/>

            <element ref="wms:OnlineResource"/>

      </sequence>

    </complexType>

  </element>

 

  <element name="OnlineResource">

    <annotation>

      <documentation>

        An OnlineResource is typically an HTTP URL.  The URL is placed in

        the xlink:href attribute, and the value "simple" is placed in the

        xlink:type attribute.

      </documentation>

    </annotation>

    <complexType>

      <attributeGroup ref="xlink:simpleLink"/>

    </complexType>

  </element>

</schema>

 

When I marshalled the class object, TestSample, I got the following XML document:

 

<?xml version="1.0" encoding="UTF-8"?>

<TestSample xmlns="http://www.opengis.net/wms">

<Title>This is a test.</Title>

<OnlineResource type="simple" href=""/>

</TestSample>

 

I would like to get the following result:

 

<?xml version="1.0" encoding="UTF-8"?>

<TestSample xmlns="http://www.opengis.net/wms" xmlns:xlink="http://www.w3.org/1999/xlink">

<Title>This is a test.</Title>

<OnlineResource xlink:type="simple" xlink:href=""/>

</TestSample>

 

Is there a way within the Castor framework to allow me to generate the correct result?

 

Thank you,

Paul T. Chu

Sr. Software Engineer

ProLogic, Inc.

E-mail: [EMAIL PROTECTED]

Phone: 703-331-5922 x2259

 

Reply via email to