You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Jeff Suttor (JIRA)" <xe...@xml.apache.org> on 2004/11/09 23:31:24 UTC

[jira] Created: (XERCESJ-1028) URIs in error messages are incorrect

URIs in error messages are incorrect
------------------------------------

         Key: XERCESJ-1028
         URL: http://nagoya.apache.org/jira/browse/XERCESJ-1028
     Project: Xerces2-J
        Type: Bug
  Components: Other  
    Versions: 2.6.2    
    Reporter: Jeff Suttor
    Priority: Minor


the URI provided in error messages are incorrect.
e.g.:

org.xml.sax.SAXParseException: http://www.w3.org/TR/xml-schema-1#cvc-datatype-valid.1.2.1?&decimal

this message contains incorrect URI path, fragment & query values.
it can also be argued that the URI should in the form [path][?query][#fragment]

is this a time to re-factor the error message formatter so it is driven by:
- spec name, version, etc.
- rule violated
- clause violated

so a more accurate URI can be constructed?

it might also be desirable to have a level of indirection between the spec name & version v. using a URI literal in the code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Node to String

Posted by IndianAtTech <in...@gmail.com>.
Hello All,

I can know hoe to convert Document to string using following method

	   public String domToString(Document doc) {
     try {
          StringWriter sw = new StringWriter();
          OutputFormat output = new OutputFormat("text", "ISO-8859-1", true);
          output.setPreserveSpace(true);
          XMLSerializer serial = new XMLSerializer(sw, output);
          serial.serialize(doc);
          return sw.toString();
     }
     catch (IOException e) {
          e.printStackTrace();
          return null;
     }


But I would like to know the method for convering Node to String.

please help me

thanks
Sudhakar

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


[jira] Commented: (XERCESJ-1028) URIs in error messages are incorrect

Posted by "Jeff Suttor (JIRA)" <xe...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XERCESJ-1028?page=comments#action_55329 ]
     
Jeff Suttor commented on XERCESJ-1028:
--------------------------------------

Michael Glavassevich is correct that the root cause of this is the lack of registering a Message Formatter for domain in which the errors occur.  registering a Message Formatter:

// format error message with Schema aware formatter
errorReporter.putMessageFormatter(
    XSMessageFormatter.SCHEMA_DOMAIN,
    new XSMessageFormatter()
);

outputs an error message in the expected format.
this issue can be closed.


> URIs in error messages are incorrect
> ------------------------------------
>
>          Key: XERCESJ-1028
>          URL: http://nagoya.apache.org/jira/browse/XERCESJ-1028
>      Project: Xerces2-J
>         Type: Bug
>   Components: Other
>     Versions: 2.6.2
>     Reporter: Jeff Suttor
>     Priority: Minor

>
> the URI provided in error messages are incorrect.
> e.g.:
> org.xml.sax.SAXParseException: http://www.w3.org/TR/xml-schema-1#cvc-datatype-valid.1.2.1?&decimal
> this message contains incorrect URI path, fragment & query values.
> it can also be argued that the URI should in the form [path][?query][#fragment]
> is this a time to re-factor the error message formatter so it is driven by:
> - spec name, version, etc.
> - rule violated
> - clause violated
> so a more accurate URI can be constructed?
> it might also be desirable to have a level of indirection between the spec name & version v. using a URI literal in the code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


[jira] Closed: (XERCESJ-1028) URIs in error messages are incorrect

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XERCESJ-1028?page=history ]
     
Michael Glavassevich closed XERCESJ-1028:
-----------------------------------------

    Resolution: Incomplete

Closing as requested.

> URIs in error messages are incorrect
> ------------------------------------
>
>          Key: XERCESJ-1028
>          URL: http://nagoya.apache.org/jira/browse/XERCESJ-1028
>      Project: Xerces2-J
>         Type: Bug
>   Components: Other
>     Versions: 2.6.2
>     Reporter: Jeff Suttor
>     Priority: Minor

>
> the URI provided in error messages are incorrect.
> e.g.:
> org.xml.sax.SAXParseException: http://www.w3.org/TR/xml-schema-1#cvc-datatype-valid.1.2.1?&decimal
> this message contains incorrect URI path, fragment & query values.
> it can also be argued that the URI should in the form [path][?query][#fragment]
> is this a time to re-factor the error message formatter so it is driven by:
> - spec name, version, etc.
> - rule violated
> - clause violated
> so a more accurate URI can be constructed?
> it might also be desirable to have a level of indirection between the spec name & version v. using a URI literal in the code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


[jira] Commented: (XERCESJ-1028) URIs in error messages are incorrect

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XERCESJ-1028?page=comments#action_55257 ]
     
Michael Glavassevich commented on XERCESJ-1028:
-----------------------------------------------

Such error text is constructed in the absence of a message formatter. If there isn't a message formatter for the given domain (in this case schema) then the error reporter panics generating this text. It's just coincidental that this looks like a meaningful reference into the spec. What you're really reading is [error domain]#[error key]?[error message arguments]. This wasn't meant to be a fetchable URI (it might not even be a URI) but since you're seeing this format it may mean that a message formatter isn't being registered in some circumstances.

Xerces should be generating something like this (and does when I test it):
org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '3x' is not a valid value for 'integer'.

Could you provide a test which produces such a message?

Thanks.

> URIs in error messages are incorrect
> ------------------------------------
>
>          Key: XERCESJ-1028
>          URL: http://nagoya.apache.org/jira/browse/XERCESJ-1028
>      Project: Xerces2-J
>         Type: Bug
>   Components: Other
>     Versions: 2.6.2
>     Reporter: Jeff Suttor
>     Priority: Minor

>
> the URI provided in error messages are incorrect.
> e.g.:
> org.xml.sax.SAXParseException: http://www.w3.org/TR/xml-schema-1#cvc-datatype-valid.1.2.1?&decimal
> this message contains incorrect URI path, fragment & query values.
> it can also be argued that the URI should in the form [path][?query][#fragment]
> is this a time to re-factor the error message formatter so it is driven by:
> - spec name, version, etc.
> - rule violated
> - clause violated
> so a more accurate URI can be constructed?
> it might also be desirable to have a level of indirection between the spec name & version v. using a URI literal in the code.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org