Author: mrglavas
Date: Thu Oct 16 14:44:20 2008
New Revision: 705371

URL: http://svn.apache.org/viewvc?rev=705371&view=rev
Log:
Improving debug info exposed by XSDocumentInfo. toString() now returns the 
targetNamespace and the schemaLocation.

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java?rev=705371&r1=705370&r2=705371&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java
 Thu Oct 16 14:44:20 2008
@@ -29,6 +29,7 @@
 import org.apache.xerces.impl.xs.util.XInt;
 import org.apache.xerces.util.SymbolTable;
 import org.apache.xerces.xni.QName;
+import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 /**
@@ -162,7 +163,23 @@
 
     // some Object methods
     public String toString() {
-        return fTargetNamespace == null?"no targetNamspace":"targetNamespace 
is " + fTargetNamespace;
+        StringBuffer buf = new StringBuffer();
+        if (fTargetNamespace == null) {
+            buf.append("no targetNamspace");
+        }
+        else {
+            buf.append("targetNamespace is ");
+            buf.append(fTargetNamespace);
+        }
+        Document doc = (fSchemaElement != null) ? 
fSchemaElement.getOwnerDocument() : null;
+        if (doc instanceof org.apache.xerces.impl.xs.opti.SchemaDOM) {
+            String documentURI = doc.getDocumentURI();
+            if (documentURI != null && documentURI.length() > 0) {
+                buf.append(" :: schemaLocation is ");
+                buf.append(documentURI);
+            }
+        }
+        return buf.toString();
     }
 
     public void addAllowedNS(String namespace) {



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

Reply via email to