You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Sudarshana Murthy <sp...@fastmail.fm> on 2004/04/08 16:19:42 UTC

Specifying XML encoding options

Hi,

How can i specify the XML encoding options (for e.g. <?xml version='1.0'
encoding='UTF-8' ?> ) for the generated XML document using XMLBeans?
Should this be done outside (like adding it after the document is
generated) of the XMLBean?

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


XmlException while parsing an XML file

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
Hi,

I am getting the XmlException while parsing an XML file. This exception
gets thrown as soon as the method
OuterDocument.Factory.parse(xmlFileName) gets called. I tried changing
the XML document (adding "xmlns" tag) a little, but having no luck still.
The XML document that i am trying to parse starts with <?xml
version="1.0" encoding="ISO-8859-1" ?>

The error i am getting is:

    XmlException: XML object is not of type D=ROOTDOCUMENT

Has anyone seen this problem before? Please let me know of any workaround
to fix this.

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


XmlException while parsing an XML file

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
Hi,

I am getting the XmlException while parsing an XML file. This exception
gets thrown as soon as the method
OuterDocument.Factory.parse(xmlFileName) gets called. I tried changing
the XML document (adding "xmlns" tag) a little, but having no luck still.
The XML document that i am trying to parse starts with <?xml
version="1.0" encoding="ISO-8859-1" ?>

The error i am getting is:

    XmlException: XML object is not of type D=ROOTDOCUMENT

Has anyone seen this problem before? Please let me know of any workaround
to fix this.

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: XML document validation

Posted by Dutta Satadip <s-...@sbcglobal.net>.
Hello !!
 
The process of validation of a xml document requires a xml schema(xsd). validation can be done via the cli like validate. XMLBeans supports streamning as well full instance validations. Validations can also be done programtically.
 
You can look at how programatic validations are done at
src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java
 
if this doesnt help, please post a snippet of your code along with some additonal description of your scenario(xsd you are trying to validate against as well as the instance that is being generated /validated). 
 
With Regards
Dutta:)
 
 


Sudarshana Murthy <sp...@fastmail.fm> wrote:
Hi,

How can i validate a XML document inside a java program versus the schema
file definition (xsd)? XML document is generated using XMLBeans. 

I did try using validate() method that is available in the Document
Interface generated from the schema compilation. This always gave a true
boolean value when i was expecting false.

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - Accessible with your email software
or over the web

- ---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

Re: XML document validation

Posted by Dutta Satadip <s-...@sbcglobal.net>.
Hello !!
 
The process of validation of a xml document requires a xml schema(xsd). validation can be done via the cli like validate. XMLBeans supports streamning as well full instance validations. Validations can also be done programtically.
 
You can look at how programatic validations are done at
src/xmlcomp/org/apache/xmlbeans/impl/tool/InstanceValidator.java
 
if this doesnt help, please post a snippet of your code along with some additonal description of your scenario(xsd you are trying to validate against as well as the instance that is being generated /validated). 
 
With Regards
Dutta:)
 
 


Sudarshana Murthy <sp...@fastmail.fm> wrote:
Hi,

How can i validate a XML document inside a java program versus the schema
file definition (xsd)? XML document is generated using XMLBeans. 

I did try using validate() method that is available in the Document
Interface generated from the schema compilation. This always gave a true
boolean value when i was expecting false.

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - Accessible with your email software
or over the web

- ---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

XML document validation

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
Hi,

How can i validate a XML document inside a java program versus the schema
file definition (xsd)? XML document is generated using XMLBeans. 

I did try using validate() method that is available in the Document
Interface generated from the schema compilation. This always gave a true
boolean value when i was expecting false.

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - Accessible with your email software
                          or over the web

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


XML document validation

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
Hi,

How can i validate a XML document inside a java program versus the schema
file definition (xsd)? XML document is generated using XMLBeans. 

I did try using validate() method that is available in the Document
Interface generated from the schema compilation. This always gave a true
boolean value when i was expecting false.

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - Accessible with your email software
                          or over the web

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Specifying XML encoding options

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
Thanks very much Dutta. The 2 links you sent are very helpful. They
discuss the solution to the problem i have.
Sudi
On Thu, 8 Apr 2004 11:08:39 -0700 (PDT), "Dutta Satadip"
<s-...@sbcglobal.net> said:
> Hello ,
> Please read the following to see if this solves your problem
> http://nagoya.apache.org/jira/browse/XMLBEANS-10
>  
> if you are using the save() menthod, to preserve encoding a byte based
> output format like OutputStream will preserve the encoding.
>  
> Also there has been some discussion on this topic in the following thread
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=xmlbeans-user@xml.apache.org&msgNo=402
> Hope this helps
> Dutta:)
> 
> 
> Sudarshana Murthy <sp...@fastmail.fm> wrote:
> Hi,
> 
> How can i specify the XML encoding options (for e.g. encoding='UTF-8' ?>
> ) for the generated XML document using XMLBeans?
> Should this be done outside (like adding it after the document is
> generated) of the XMLBean?
> 
> Appreciate your response
> Sudi
> 
> -- 
> http://www.fastmail.fm - A no graphics, no pop-ups email service
> 
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail: xmlbeans-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Specifying XML encoding options

Posted by Sudarshana Murthy <sp...@fastmail.fm>.
Thanks very much Dutta. The 2 links you sent are very helpful. They
discuss the solution to the problem i have.
Sudi
On Thu, 8 Apr 2004 11:08:39 -0700 (PDT), "Dutta Satadip"
<s-...@sbcglobal.net> said:
> Hello ,
> Please read the following to see if this solves your problem
> http://nagoya.apache.org/jira/browse/XMLBEANS-10
>  
> if you are using the save() menthod, to preserve encoding a byte based
> output format like OutputStream will preserve the encoding.
>  
> Also there has been some discussion on this topic in the following thread
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=xmlbeans-user@xml.apache.org&msgNo=402
> Hope this helps
> Dutta:)
> 
> 
> Sudarshana Murthy <sp...@fastmail.fm> wrote:
> Hi,
> 
> How can i specify the XML encoding options (for e.g. encoding='UTF-8' ?>
> ) for the generated XML document using XMLBeans?
> Should this be done outside (like adding it after the document is
> generated) of the XMLBean?
> 
> Appreciate your response
> Sudi
> 
> -- 
> http://www.fastmail.fm - A no graphics, no pop-ups email service
> 
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail: xmlbeans-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Specifying XML encoding options

Posted by Dutta Satadip <s-...@sbcglobal.net>.
Hello ,
Please read the following to see if this solves your problem
http://nagoya.apache.org/jira/browse/XMLBEANS-10
 
if you are using the save() menthod, to preserve encoding a byte based output format like OutputStream will preserve the encoding.
 
Also there has been some discussion on this topic in the following thread
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=xmlbeans-user@xml.apache.org&msgNo=402
Hope this helps
Dutta:)


Sudarshana Murthy <sp...@fastmail.fm> wrote:
Hi,

How can i specify the XML encoding options (for e.g. encoding='UTF-8' ?> ) for the generated XML document using XMLBeans?
Should this be done outside (like adding it after the document is
generated) of the XMLBean?

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

- ---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

Re: Specifying XML encoding options

Posted by Dutta Satadip <s-...@sbcglobal.net>.
Hello ,
Please read the following to see if this solves your problem
http://nagoya.apache.org/jira/browse/XMLBEANS-10
 
if you are using the save() menthod, to preserve encoding a byte based output format like OutputStream will preserve the encoding.
 
Also there has been some discussion on this topic in the following thread
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=xmlbeans-user@xml.apache.org&msgNo=402
Hope this helps
Dutta:)


Sudarshana Murthy <sp...@fastmail.fm> wrote:
Hi,

How can i specify the XML encoding options (for e.g. encoding='UTF-8' ?> ) for the generated XML document using XMLBeans?
Should this be done outside (like adding it after the document is
generated) of the XMLBean?

Appreciate your response
Sudi

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

- ---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/