Hello Arnaud,
Thank you for your suggestion.  We made use of the setNamespaceMapping
method to regain the
"METS:" namespace prefix, when Marshalling, but, we are still running into
a problem in retaining the
"xlink:" namespace prefix.

The METS.xsd has the schema namespace declarations:
     <xsd:schema targetNamespace="http://www.loc.gov/METS/";
                                                xmlns:xlink="
http://www.w3.org/TR/xlink";
                                                  xmlns:xsd="
http://www.w3.org/2001/XMLSchema";
                                                          xmlns="
http://www.loc.gov/METS/";
                             elementFormDefault="qualified"
                             attributeFormDefault="unqualified">
      <xsd:import namespace="http://www.w3.org/TR/xlink";
                     schemaLocation="/path1/path2/path3/xlink.xsd" />

 ...as you may recall.   We suspect the imported xlink.xsd may lost during
UnMarshalling, although we don't encounter
any Castor processing error(s) when running our processor.  We have been
using the following calls, per your suggestion:

                            marshaller.setNamespaceMapping("METS","
http://www.loc.gov/METS/";);
                            marshaller.setNamespaceMapping("xsi","
http://www.w3.org/2001/XMLSchema-instance";);
                            marshaller.setNamespaceMapping("xlink","
http://www.w3.org/TR/xlink";);

                            marshaller.marshal(metsDoc);

but the "xlink:" prefix for the xlink namespace is not getting output (as
we showed in earlier email re the
"xlink:href" example).

Question:  is there a way to ask of something like the SchemaUnmarshaller
that we wish to assure the retention of
the namespace mapping of "xlink", "http://www.w3.org/TR/xlink";?   The
unique aspect of the xlink.xsd is that it
contains attributes, only, and it is not a schema that can be compiled
separately to create its own classes.

I hope the above makes sense -- please let me know if we might be able to
request that Castor retain the imported
namespace/schemaLocation -- or, if I've misunderstood the processing logic
here.

Many thanks,

..Mike Sanderson & Ho-chun Chin








                                                                                       
                        
                    "Arnaud                                                            
                        
                    Blandin"             To:     [EMAIL PROTECTED]                 
                        
                    <blandin@intal       cc:                                           
                        
                    io.com>              Subject:     Re: [castor-dev] Re:Trying to 
import  Xlink.xsd --       
                                                                                       
                        
                    09/25/2002                                                         
                        
                    11:50 PM                                                           
                        
                    Please respond                                                     
                        
                    to castor-dev                                                      
                        
                                                                                       
                        
                                                                                       
                        




Hi Mike,

Currently the Source Generator is not keeping the prefix chosen in the
XML Schema. It will assume that the target namespace is the default
namespace (no prefix), we'll improve that in future releases.
What you can do for the moment is instantiate your own Marshaller and
use setNamespaceMapping to define your (prefix, namespace) mapping.

Let me know if it is ok for you,

Arnaud

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, September 25, 2002 12:24 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] Re:Trying to import Xlink.xsd --
>
>
> Hi, Arnaud -- sorry to be a bother.  Have you had a chance to check
> this
> problem?
>
> Many thanks,
>
> ..Mike
>
>
>
>
>                     Mike Sanderson
>                                          To:     castor-
> [EMAIL PROTECTED]
>                     09/23/2002           cc:
>                     10:23 AM             Subject:     Re:Trying to
> import  Xlink.xsd -- (Document link: Mike
>                                          Sanderson)
>
>
>
>
> Thanks, Arnaud,
>
> Here is an example input & output .xml files ( which should be
> processed
> through the mets.xsd (and xlink.xsd) schemas):
>
> Input .xml:
> --------------
> (See attached file: test_mets.xml)
>
> Output .xml file (from our most recent run):
> ---------------------------------------------------------
> (See attached file: metsOut4.xml)
>
>
> Here's the mets.xsd:
> -----------------------------
> (See attached file: mets.xsd)
>
> Here's the Xlink:xsd:
> -----------------------------
> (See attached file: xlink.xsd)
>
> Again, many thanks for looking into this for us.
>
> ..Mike
>
>
>
>
>
>
>
>
>                     "Arnaud
>                     Blandin"             To:     castor-
> [EMAIL PROTECTED]
>                     <blandin@intal       cc:
>                     io.com>              Subject:     Re: [castor-
> dev] To: [EMAIL PROTECTED]
>
>                     09/23/2002
>                     06:55 AM
>                     Please respond
>                     to castor-dev
>
>
>
>
>
>
> Hi Mike,
>
> The XML Schema xlink.xsd only defines attributes and attributeGroups
> so
> seeing no class generated from it is the correct behavior.
> The warning message is output each time Castor encounters a <import>
> statement without really knowing if it is really needed to generate
> sources for the imported schemas.
>
> Besides according to the xlink Schema, the simpleLink attribute is
> defined as below:
>
> <attributeGroup name="simpleLink">
>     <attribute name="type" type="string" fixed="simple"
> form="qualified"
> />
>     <attribute ref="xlink:href" use="optional" />
>     <attribute ref="xlink:role" use="optional" />
>     <attribute ref="xlink:arcrole" use="optional" />
>     <attribute ref="xlink:title" use="optional" />
>     <attribute ref="xlink:show" use="optional" />
>     <attribute ref="xlink:actuate" use="optional" />
> </attributeGroup>
>
> So the output of type="simple" is correct. However there might be a
> problem of namespace declaration. Can you please post the XML Schema
> you
> use and a simple as possible test case that demonstrates the problem
> for
> further investigation?
>
> Thanks,
>
> Arnaud
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, September 21, 2002 12:50 AM
> > To: [EMAIL PROTECTED]
> > Subject: [castor-dev] To: [EMAIL PROTECTED]
> >
> > Did anyone have a problem with importing xlink.xsd?  We have tried
> > to run a
> > schema (mets.xsd) which imports xlink.xsd. When we ran
> > SourceGenerator
> > on mets.xsd, we got the message "Warning: Do not forget to
> generate
> > source
> > code for the following imported schema: xlink.xsd". We then tried
> to
> > run
> > SrouceGenerator on xlink.xsd, but no source code is generated nor
> > are any
> > errors.  The mets.xsd includes the following lines:
> >
> >  <xsd:element name="FLocat" minOccurs="0">
> >  <xsd:annotation>
> >   <xsd:documentation>FLocat: File Location. The FLocat element
> > provides a
> > pointer to the location of a content file. It uses the XLink
> syntax
> > to
> > provide linking information indicating the actual location of the
> > content
> > file, along with a few additional attributes specifying additional
> > linking
> > information. The full attribute set for the FLocat element is as
> > follows:
> > 1. ID (an XML ID); 2. LOCTYPE: the type of locator contained in
> the
> > FLocat
> > element; and 3. OTHERLOCTYPE: a string to indicate an alternative
> > LOCTYPE
> > if the LOCTYPE attribute itself has a value of "OTHER"; 4.
> > xlink:href: see
> > XLink standard (http://www.w3.org/TR/xlink) 5. xlink:role: "" 6.
> > xlink:arcrole: "" 7. xlink:title: "" 8. xlink:show: "" 9.
> > xlink:actuate: ""
> > NOTE: FLocat is an empty element. The location of the resource
> > pointed to
> > MUST be stored in the xlink:href element.</xsd:documentation>
> >   </xsd:annotation>
> >  <xsd:complexType>
> >   <xsd:attribute name="ID" type="xsd:ID" use="optional" />
> >   <xsd:attributeGroup ref="LOCATION" />
> >   <xsd:attributeGroup ref="xlink:simpleLink" />
> >   </xsd:complexType>
> >   </xsd:element>
> >
> >
> > We tried to marshal an input mets.xml and then unmarshal it, the
> > input line
> >
> > <METS:FLocat LOCTYPE="URL" xlink:href
> >
> ="http://depot102.rlg.org/repos002/02/0410/02DCLC0008.08/402.jpg"/>
> >
> > becomes
> >
> > <FLocat LOCTYPE="URL" type="simple" href
> >
> ="http://depot102.rlg.org/repos002/02/0410/02DCLC0008.08/399.jpg"/>
> >
> > which is incorrect.
> >
> > Any suggestion and help is highly appreciated.
> >
> >
> > Mike.
> >
> >  The following is the xlink.xsd:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <schema targetNamespace="http://www.w3.org/TR/xlink"; xmlns
> > ="http://www.w3.org/2001/XMLSchema"; xmlns:xlink
> > ="http://www.w3.org/TR/xlink"; elementFormDefault="qualified">
> >   <!--  global attributes  -->
> >   <attribute name="href"  type="anyURI"/>
> >   <attribute name="role" type="string"/>
> >   <attribute name="arcrole" type="string"/>
> >   <attribute name="title" type="string" />
> >   <attribute name="show">
> >     <simpleType>
> >       <restriction base="string">
> >      <enumeration value="new" />
> >      <enumeration value="replace" />
> >      <enumeration value="embed" />
> >      <enumeration value="other" />
> >      <enumeration value="none" />
> >       </restriction>
> >     </simpleType>
> >   </attribute>
> >   <attribute name="actuate">
> >     <simpleType>
> >       <restriction base="string">
> >      <enumeration value="onLoad" />
> >      <enumeration value="onRequest" />
> >      <enumeration value="other" />
> >      <enumeration value="none" />
> >       </restriction>
> >     </simpleType>
> >   </attribute>
> >   <attribute name="label" type="string" />
> >   <attribute name="from" type="string" />
> >   <attribute name="to" type="string" />
> >   <attributeGroup name="simpleLink">
> >     <attribute name="type" type="string" fixed="simple"
> > form="qualified" />
> >     <attribute ref="xlink:href" use="optional" />
> >     <attribute ref="xlink:role" use="optional" />
> >     <attribute ref="xlink:arcrole" use="optional" />
> >     <attribute ref="xlink:title" use="optional" />
> >     <attribute ref="xlink:show" use="optional" />
> >     <attribute ref="xlink:actuate" use="optional" />
> >   </attributeGroup>
> >   <attributeGroup name="extendedLink">
> >     <attribute name="type" type="string" fixed="extended"
> > form="qualified"
> > />
> >     <attribute ref="xlink:role" use="optional" />
> >     <attribute ref="xlink:title" use="optional" />
> >   </attributeGroup>
> >   <attributeGroup name="locatorLink">
> >     <attribute name="type" type="string" fixed="locator"
> > form="qualified"
> > />
> >     <attribute ref="xlink:href" use="required" />
> >     <attribute ref="xlink:role" use="optional" />
> >     <attribute ref="xlink:title" use="optional" />
> >     <attribute ref="xlink:label" use="optional" />
> >   </attributeGroup>
> >   <attributeGroup name="arcLink">
> >     <attribute name="type" type="string" fixed="arc"
> > form="qualified" />
> >     <attribute ref="xlink:arcrole" use="optional" />
> >     <attribute ref="xlink:title" use="optional" />
> >     <attribute ref="xlink:show" use="optional" />
> >     <attribute ref="xlink:actuate" use="optional" />
> >     <attribute ref="xlink:from" use="optional" />
> >     <attribute ref="xlink:to" use="optional" />
> >   </attributeGroup>
> >   <attributeGroup name="resourceLink">
> >     <attribute name="type" type="string" fixed="resource"
> > form="qualified"
> > />
> >     <attribute ref="xlink:role" use="optional" />
> >     <attribute ref="xlink:title" use="optional" />
> >     <attribute ref="xlink:label" use="optional" />
> >   </attributeGroup>
> >   <attributeGroup name="titleLink">
> >     <attribute name="type" type="string" fixed="title"
> > form="qualified" />
> >   </attributeGroup>
> >   <attributeGroup name="emptyLink">
> >     <attribute name="type" type="string" fixed="none"
> > form="qualified" />
> >   </attributeGroup>
> > </schema>
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> >    unsubscribe castor-dev
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>      unsubscribe castor-dev
>
>
>

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
     unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to