Subjects
Home
VOTE Move XML Commons to Xerces
Commented: (XERCESJ 589) Bug with pattern restriction on long strings
: Xerces J 2 8 1 Release on Wednesday, September 13th
: Xerces J 2 9 0 Release on Wednesday, November 22nd
Commented: (XERCESJ 1066) Restriction+choice+substitutionGroup error
Commented: (XERCESJ 1178) Error getting prefix for an attribute with no n
Updated: (XERCESJ 1244) XMLSchemaValidator does not contribute element 's
Some consideration about the xerces DOM implementation
Updated: (XERCESJ 1066) Restriction+choice+substitutionGroup error
Commented: (XERCESJ 1227) Poor performance / OutOfMemoryError for sequenc
retain exception stack traces
Updated: (XERCESJ 1193) NPE or hang when parsing using the "continue afte
Future of NekoHTML
Commented: (XERCESJ 1203) NPE in XMLDTDProcessor
DOM Level 3 APIs for Xalan J and a new Xalan release (2 7 1)
: xml commons external 1 3 04 Release on Wednesday, November 22nd
Commented: (XERCESJ 1247) Incorrect location information on SAX when usin
XInclude exceptions how to mirror Xerces J functionality into Xerces C++?
First proposal on SoC project "Add support for the StAX (JSR 173) cursor API
: xml commons resolver 1 2 Release on Wednesday, November 22nd
Typo in RangeToken java Please check
Validator features
java lang ClassCastException when adopting Node
using the org apache xerces impl xs identity package
Updated: (XERCESJ 1257) buffer overflow in UTF8Reader for characters out
Problem with ref attributes and schema validation
Updated: (XERCESJ 122) XMLSchemaValidator does not contribute element 's d
Performance problem under load Xerces with Weblogic 9 x
remove ignored memory allocation
Commented: (XERCESJ 1177) SAXXMLStreamReader doesn 't always report namesp
Commented: (XERCESJ 977) Null pointer exception during DOM parsing
Commented: (XERCESJ 1197) Code cleanup for org apache xml serialize
Commented: (XERCESJ 1201) Initial contribution for StAX Event API
Updated: (XERCESJ 1061) Regex "$ " and "^ " characters treated as special c
Commented: (XERCESJ 1199) SAXXMLStreamReader should attempt to register a
Commented: (XERCESJ 1061) Regex "$ " and "^ " characters treated as special
Updated: (XERCESJ 589) Bug with pattern restriction on long strings
StackOverflow
xerces Range unnecessarily not garbage collectable if not detached
Updated: (XERCESJ 1178) Error getting prefix for an attribute with no nam
Bug in xs:redefine
Commented: (XERCESJ 1204) Can not set XMLEntityResolver for LSParser
Updated: (XERCESJ 1253) Prototype for SoC2007 project "Add support for th
Updated: (XERCESJ 1259) Add SteamFilter Function to SoC2007 project "Add
Assigned: (XERCESJ 444) SAXException thrown by EntityResolver is reported
Google Summer of Code 2007
Xerces J and XInclude relative path issue
Assigned: (XERCESJ 206) Stack overflow when using a schema validation
Commented: (XERCESJ 1215) Restrictions involving two levels of substituti
Closed: (XERCESJ 1203) NPE in XMLDTDProcessor
non overriding equals methoda
Resolved: (XERCESJ 1079) invalid value returned for TOTALDIGITS facet in
Xerces AS3 port
Updated: (XERCESJ 325) Regular Expression; Pattern "| " clause order de
Updated: (XERCESJ 1196) Javadoc generation fails on Java SE 5 0
Closed: (XERCESJ 1202) DTD validation on XIncluded documents when the sch
Created: (XERCESJ 1124) Nonspecific schema error message
a bug in xerces
Updated: (XERCESJ 1201) Initial contribution for StAX Event API
Closed: (XERCESJ 1254) Empty uris in targetNamespace attribute not report
Links
Home
Oracle database error code
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Help whit validation in Web services (xerces )

Help whit validation in Web services (xerces )

2003-10-02       - By Zulema Olguin
Reply:     1     2  

Hi

I working  whit Web service in java,  axis and  Xerces2,  this web
service get like paremeter  an  XML,  the which use a schema whith
restriction, but the validations no work, when i introduce a bad
parameter.

Note: The error of validation are write by catalina.out


the xsd and xml was generate whith xmlspy


<?xml version="1.0" encoding="UTF-8"?>
<data xmlns:xsi="  <http://www.w3.org/2001/XMLSchema-instance>
http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="1.xsd">
<data1>123</data1>
<data2>1213</data2>
</data>


<?xml version="1.0" encoding="UTF-8"?>
<!--W3C Schema generated by XMLSPY v5 rel. 4 U (
<http://www.xmlspy.com/> http://www.xmlspy.com)-->
<xs:schema xmlns:xs="  <http://www.w3.org/2001/XMLSchema>
http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="data">
 <xs:complexType>
  <xs:sequence>
   <xs:element ref="data1"/>
   <xs:element ref="data2"/>
  </xs:sequence>
 </xs:complexType>
</xs:element>
<xs:element name="data1" type="xs:number"/>
<xs:element name="data2" type="xs:number"/>
</xs:schema>




The program is :


import javax.xml.parsers.*;
import org.apache.xpath.*;
import org.w3c.dom.*;
import org.apache.xpath.*;

import java.util.Hashtable;

import org.apache.xerces.parsers.DOMParser;
import org.xml.sax.ErrorHandler;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

import org.xml.sax.SAXParseException;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;

import org.xml.sax.InputSource;
import org.xml.sax.*;
import java.io.IOException;
import java.io.StringReader;
import java.io.*;


public class z {
 

  // Funciones Xpaht

//======================================================================
=
   private static String findValue(Node node, String xql) throws
Exception
   {
       // se validan los parametros de entrada
       if( (xql == null) || (xql.length() == 0) ) {
         throw new Exception("ERROR: findValue llamado con segundo
parametro(xql) vacio");
       }
       if(node == null) {
           throw new Exception("ERROR: findValue llamado con primer
parametro(node) nulo");
        throw new Exception("ERROR: findValue llamado con primer
parametro(node) nulo");
       }
       return
getValorHijoDependiendoDeQuery(XPathAPI.selectSingleNode(node,xql) );
   }


   private static String getValorHijoDependiendoDeQuery ( Node node )
   {
       NodeList NodosHijos;
       StringBuffer valor = new StringBuffer();
       NodosHijos =  node.getChildNodes();
       for(int i=0; i < NodosHijos.getLength(); i++ )
       {
           if( NodosHijos.item(i).getNodeType() == Node.TEXT_NODE )
           {
               valor.append(NodosHijos.item(i).getNodeValue());
           }
       }
       return valor.toString();
   }

   public String getz(String xmlString) {

       String sxm=null;
       String respRenta = null;
       DOMParser parser = new DOMParser();


       try {

           // paso 1 recibe xml desde parametro y valida el esquema

//======================================================================
=


           parser.setFeature (" http://xml.org/sax/features/namespaces
<http://xml.org/sax/features/namespaces> ", true);
           parser.setFeature (" http://xml.org/sax/features/validation
<http://xml.org/sax/features/validation> ", true);
           parser.setFeature ("
http://apache.org/xml/features/validation/schema
<http://apache.org/xml/features/validation/schema> ", true);
           parser.setFeature ("
http://apache.org/xml/features/validation/schema-full-checking
<http://apache.org/xml/features/validation/schema-full-checking> ",
true);

           parser.setFeature("
http://apache.org/xml/features/dom/defer-node-expansion
<http://apache.org/xml/features/dom/defer-node-expansion> ", true);
           parser.setFeature("
http://apache.org/xml/features/continue-after-fatal-error
<http://apache.org/xml/features/continue-after-fatal-error> ", true);

           
           parser.parse(new InputSource(new StringReader(xmlString)) );
           Document document = parser.getDocument();



//======================================================================
=
           Element root        = document.getDocumentElement();
           Node configNode     = root.getFirstChild();
           NodeList childNodes = configNode.getChildNodes();

           // Forma URL

//======================================================================
=
           String URL  = "d1=" + findValue( root, "/data/d1" ) + "&";
                  URL += "d2=" + findValue( root, "/data/d2" ) + "&";
                  URL += "d3=" + findValue( root, "/data/d3" ) ;

                     return  URL;

       } catch (SAXNotRecognizedException ex4) {
            return "ERROR SAXNotRecognizedException: " +
ex4.toString();
       } catch (SAXNotSupportedException ex5) {
            return "ERROR SAXNotSupportedException: " + ex5.toString();
       } catch (SAXParseException ex1) {
            return "ERROR SAXParseException: " + ex1.toString();
       } catch (SAXException ex) {
            return "ERROR SAXException: " + ex.toString();
            //return "Error SAXException: NO PUDE PARSEAR";
       } catch (Exception e2) {
            return "ERROR Exception: " + e2.toString()+ "chao";
            //return "Error Exception : NO PUDE PARSEAR";
       }
     }


Gracias.-
Zulema Olguin T.
Chile



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD>
<BODY style="COLOR: #000000; FONT-FAMILY: Arial" hb_focus_attach="true">
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia
size=2>Hi</FONT></EM></SPAN></DIV>
<DIV><SPAN class=000185620-26092003><FONT face=Georgia
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia size=2>I working
&nbsp;whit Web service in java<SPAN class=375134823-02102003>,</SPAN>&nbsp;
<SPAN
class=375134823-02102003> axis </SPAN>and&nbsp; Xerces2, &nbsp;this web service
get like paremeter &nbsp;an &nbsp;XML, &nbsp;the which use a schema whith
restriction, but the validations no work, when i introduce a bad
parameter.</FONT></EM></SPAN></DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia
size=2></FONT></EM></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><SPAN class=375134823-02102003><FONT
face=Georgia size=2>Note: The error of validation are write by catalina.out
</FONT></SPAN></EM></SPAN></DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia
size=2></FONT></EM></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia
size=2></FONT></EM></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia size=2>the xsd and
xml was generate whith xmlspy </FONT></EM></SPAN></DIV>
<DIV><SPAN class=000185620-26092003><FONT face=Georgia
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><FONT face=Georgia
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia size=2>&lt;?xml
version="1.0" encoding="UTF-8"?&gt;<BR>&lt;data xmlns:xsi="</FONT></EM><A
href="http://www.w3.org/2001/XMLSchema-instance"><EM><FONT face=Georgia
size=2>http://www.w3.org/2001/XMLSchema-instance</FONT></EM></A><EM><FONT
face=Georgia size=2>"
xsi:noNamespaceSchemaLocation="1.xsd"&gt;<BR>&nbsp;&lt;data1&gt;123&lt;/data1
&gt;<BR>&nbsp;&lt;data2&gt;1213&lt;/data2&gt;<BR>&lt;/data&gt;<BR></FONT></EM><
/SPAN></DIV>
<DIV><SPAN class=000185620-26092003><FONT face=Georgia
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia size=2>&lt;?xml
version="1.0" encoding="UTF-8"?&gt;<BR>&lt;!--W3C Schema generated by XMLSPY v5
rel. 4 U (</FONT></EM><A href="http://www.xmlspy.com/"><EM><FONT face=Georgia
size=2>http://www.xmlspy.com</FONT></EM></A><EM><FONT face=Georgia
size=2>)--&gt;<BR>&lt;xs:schema xmlns:xs="</FONT></EM><A
href="http://www.w3.org/2001/XMLSchema"><EM><FONT face=Georgia
size=2>http://www.w3.org/2001/XMLSchema</FONT></EM></A><EM><FONT face=Georgia
size=2>" elementFormDefault="qualified"&gt;<BR>&nbsp;&lt;xs:element
name="data"&gt;<BR>&nbsp;&nbsp;&lt;xs:complexType&gt;<BR>&nbsp;&nbsp;&nbsp;&lt
;xs:sequence&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element
ref="data1"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;xs:element
ref="data2"/&gt;<BR>&nbsp;&nbsp;&nbsp;&lt;/xs:sequence&gt;<BR>&nbsp;&nbsp;&lt;
/xs:complexType&gt;<BR>&nbsp;&lt;/xs:element&gt;<BR>&nbsp;&lt;xs:element
name="data1" type="xs:number"/&gt;<BR>&nbsp;&lt;xs:element name="data2"
type="xs:number"/&gt;<BR>&lt;/xs:schema&gt;</FONT></EM></SPAN></DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia
size=2></FONT></EM></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia
size=2></FONT></EM></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia
size=2></FONT></EM></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><EM><FONT face=Georgia
size=2></FONT></EM></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><FONT
face=Georgia size=2><EM>The program is :</EM></FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><EM><FONT
face=Georgia size=2></FONT></EM></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><EM><FONT
face=Georgia size=2></FONT></EM></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><FONT
size=2>import javax.xml.parsers.*;<BR>import org.apache.xpath.*;<BR>import
org.w3c.dom.*;<BR>import org.apache.xpath.*;</FONT></SPAN></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><FONT
size=2>import java.util.Hashtable;</FONT></SPAN></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><FONT
size=2>import org.apache.xerces.parsers.DOMParser;<BR>import
org.xml.sax.ErrorHandler;<BR>import org.w3c.dom.Document;<BR>import
org.w3c.dom.Node;<BR>import org.w3c.dom.Element;<BR>import
org.w3c.dom.NodeList;</FONT></SPAN></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><FONT
size=2>import org.xml.sax.SAXParseException;<BR>import
org.xml.sax.SAXException;<BR>import
org.xml.sax.SAXNotRecognizedException;<BR>import
org.xml.sax.SAXNotSupportedException;</FONT></SPAN></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><FONT
size=2>import org.xml.sax.InputSource;<BR>import org.xml.sax.*;<BR>import
java.io.IOException;<BR>import java.io.StringReader;<BR>import
java.io.*;<BR></FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=000185620-26092003><SPAN
class=375134823-02102003></SPAN></SPAN><SPAN class=000185620-26092003><SPAN
class=375134823-02102003></SPAN></SPAN><SPAN class=000185620-26092003><SPAN
class=375134823-02102003><FONT size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><FONT
size=2>public class z {</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=000185620-26092003><SPAN class=375134823-02102003><FONT
size=2>&nbsp;&nbsp; </FONT></SPAN></SPAN></DIV><SPAN
class=000185620-26092003><SPAN class=375134823-02102003><FONT size=2>
<DIV><BR>&nbsp;&nbsp; // Funciones Xpaht<BR>&nbsp;&nbsp;
//=======================================================================<BR>
&nbsp;&nbsp;&nbsp;
private static String findValue(Node node, String xql) throws
Exception<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// se validan los parametros de
entrada<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( (xql == null) ||
(xql.length() == 0) )
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new
Exception("ERROR: findValue llamado con segundo parametro(xql)
vacio");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(node == null)
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw
new Exception("ERROR: findValue llamado con primer parametro(node) nulo");</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new
Exception("ERROR: findValue llamado con primer parametro(node)
nulo");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
getValorHijoDependiendoDeQuery(XPathAPI.selectSingleNode(node,xql)
);<BR>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp; private static String
getValorHijoDependiendoDeQuery
( Node node )<BR>&nbsp;&nbsp;&nbsp;
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NodeList
NodosHijos;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringBuffer valor =
new StringBuffer();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NodosHijos
=&nbsp; node.getChildNodes();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for(int i=0; i &lt; NodosHijos.getLength(); i++
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(
NodosHijos.item(i).getNodeType() == Node.TEXT_NODE
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
valor.append(NodosHijos.item(i).getNodeValue());<BR>&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
valor.toString();<BR>&nbsp;&nbsp;&nbsp; }</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; public String getz(String xmlString) {</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String
sxm=null;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String respRenta =
null;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DOMParser parser = new
DOMParser();</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try {</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
paso 1 recibe xml desde parametro y valida el
esquema<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//=======================================================================</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parser.setFeature ("<A
href="http://xml.org/sax/features/namespaces">http://xml.org/sax/features
/namespaces</A>",
true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parser.setFeature ("<A
href="http://xml.org/sax/features/validation">http://xml.org/sax/features
/validation</A>",
true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parser.setFeature ("<A
href="http://apache.org/xml/features/validation/schema">http://apache.org/xml
/features/validation/schema</A>",
true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parser.setFeature ("<A
href="http://apache.org/xml/features/validation/schema-full-checking">http:/
/apache.org/xml/features/validation/schema-full-checking</A>",
true);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parser.setFeature("<A
href="http://apache.org/xml/features/dom/defer-node-expansion">http://apache
.org/xml/features/dom/defer-node-expansion</A>",
true);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parser.setFeature("<A
href="http://apache.org/xml/features/continue-after-fatal-error">http://apache
.org/xml/features/continue-after-fatal-error</A>",
true);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parser.parse(new InputSource(new StringReader(xmlString))
);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Document document = parser.getDocument();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;
//=======================================================================<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Element root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
document.getDocumentElement();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;
Node configNode&nbsp;&nbsp;&nbsp;&nbsp; =
root.getFirstChild();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
NodeList childNodes = configNode.getChildNodes();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //
Forma
URL&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//=======================================================================<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
String URL&nbsp; = "d1=" + findValue( root, "/data/d1" ) +
"&amp;";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
URL += "d2=" + findValue( root, "/data/d2" ) +
"&amp;";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
URL += "d3=" + findValue( root, "/data/d3" ) ;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return&nbsp; URL;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch
(SAXNotRecognizedException ex4)
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return "ERROR SAXNotRecognizedException: " +
ex4.toString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch
(SAXNotSupportedException ex5)
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return "ERROR SAXNotSupportedException: " +
ex5.toString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch
(SAXParseException ex1)
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return "ERROR SAXParseException: " +
ex1.toString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch
(SAXException ex)
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return "ERROR SAXException: " +
ex.toString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
//return "Error SAXException: NO PUDE
PARSEAR";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch (Exception e2)
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return "ERROR Exception: " + e2.toString()+
"chao";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;
//return "Error Exception : NO PUDE
PARSEAR";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR></DIV>
<DIV>&nbsp;</DIV></FONT></SPAN></SPAN><FONT face="Times New Roman">
<DIV><SPAN class=375134823-02102003></SPAN><FONT face=Arial><FONT size=2>G<SPAN
class=375134823-02102003>racias.-</SPAN></FONT></FONT><BR></FONT><I></I><I>
<FONT
face=Georgia size=2>Zulema Olguin T.</FONT></I></DIV>
<DIV><FONT face="Times New Roman"><SPAN
class=375134823-02102003></SPAN><EM><FONT face=Georgia><FONT size=2>C<SPAN
class=375134823-02102003>hile </SPAN></FONT></FONT></EM><BR></DIV></FONT>
<P></P></BODY></HTML>