Anyone have any suggestions on this.  I am still stuck and not sure
how to proceed.

TIA,

Scott

On 12/19/05, Scott Curry <[EMAIL PROTECTED]> wrote:
> Hello all again,
>
> I have another question. I am trying to generate XML like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sv:InboundTrnx Attr1="Ex1" Attr2="Ex2"
>    xsi:schemaLocation="http://schemalocation/ InboundTrnx_1_0.xsd"
>    xmlns:sv="http://schemalocation";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
> <NextElement />
> </sv:InboundTrnx>
>
> NOTE: The order of attributes in the above element.
>
> However, I am getting XML like this instead:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <sv:InboundTrnx xmlns:sv="http://schemalocation";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:schemaLocation="http://schemalocation InboundTrnx_1_0.xsd "
> Attr2="Ex2" Attr1="Ex1">
> <sv:NextElement />
> </sv:InboundTrnx>
>
> Here is the snippet of code I am using to create the namespaces:
>
>           Marshaller marshaller = new Marshaller(output);
>            marshaller.setResolver(resolver);
>            marshaller.setSupressXMLDeclaration(suppressXMLDeclaration);
>            marshaller.setMarshalAsDocument(!suppressXMLDeclaration);
>   marshaller.setSchemaLocation("http://schemalocation InboundTrnx_1_0.xsd ");
>            marshaller.setNamespaceMapping("sv", "http://schemalocation";);
>            marshaller.setEncoding("UTF-8");
>            // This fixes an issue where the root element name is not 
> correct...
>            marshaller.setRootElement("InboundTrnx");
>            marshaller.marshal(value);
>
>
>
> I am working with a third party who's parser requires the order of the
> namespace declarations to be as above - bad (illegal XML?) I know -
> but it is required.
>
> Is there any way to specify the order in which the namespaces are generated?
>
> Also, they want only the root element to have the namespace prefix and
> all the children to have no prefix (assume the root's prefix).  Can
> this be done?
>
> TIA,
>
> Scott
>

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to