Please ignore. I found the solution, albeit a little unclear

<xs:schema

     elementFormDefault="qualified"

        targetNamespace="customerror.xml.acmeweb.com"   
xmlns:tns="customerror.xml.acmeweb.com" 
xmlns:xs="http://www.w3.org/2001/XMLSchema";>


By adding the 'elementFormDefault="qualified"' into my XSD 
and calling xmlOptions.setUseDefaultNamespace();  prior to saving, I am able to 
get what I want.  Hopefully this will help someone else in the future.







--- On Mon, 10/6/08, Frank Z <[EMAIL PROTECTED]> wrote:

> From: Frank Z <[EMAIL PROTECTED]>
> Subject: default namespace and empty namespace (xmlns="") during 
> serialization.
> To: [email protected]
> Date: Monday, October 6, 2008, 12:13 PM
> Apologize in advance if this has been asked before. I am
> still a little confused as to how to serialize a document
> with basic namespace handling
> 
> When I use the default option (ie. none), serializing my
> document yields
> the following
> 
> <?xml version="1.0"
> encoding="UTF-8"?>
> <cus:CustomErrors
> xmlns:cus="http://customerror.xml.acmeweb.com";>
>   <WarningFlag>false</WarningFlag>
>   <ErrorFlag>true</ErrorFlag>
>   <FatalErrorFlag>false</FatalErrorFlag>
>   <ErrorCount>2</ErrorCount>
> 
> If I turn call xmlOptions.setUseDefaultNamespace() prior to
> serializing, I get
> 
> 
> <CustomErrors
> xmlns="http://customerror.xml.acmeweb.com";>
>   <WarningFlag
> xmlns="">false</WarningFlag>
>   <ErrorFlag
> xmlns="">true</ErrorFlag>
>   <FatalErrorFlag
> xmlns="">false</FatalErrorFlag>
>   <ErrorCount xmlns="">2</ErrorCount>
> ...
> 
> This is probably worse because most of our customers simply
> don't know how to handle xmlns="" in the child
> element.
> 
> Is there a simple way to serialize my document and get
> somethign like this (ie. without any prefix?)
> 
> <?xml version="1.0"
> encoding="UTF-8"?>
> <CustomErrors
> xmlns:"http://customerror.xml.acmeweb.com";>
>   <WarningFlag>false</WarningFlag>
>   <ErrorFlag>true</ErrorFlag>
>   <FatalErrorFlag>false</FatalErrorFlag>
>   <ErrorCount>2</ErrorCount>
> 
> I've searched FAQ and googled but found no simple
> answers for this question.
> 
> Thanks in advance
> Frank.
> 
> 
> 
> 
>       
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]


      

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to