Generating XML content with SAX including schema reference

Hi all, XML newbie question here.
I'm trying to generate an XML document from a certain file format using SAX, but I can't figure out how to get the generated XML document to include a schema reference.
Here's the code, it's taken from posts on this forum, so it should be familiar:
StreamResult streamResult = new StreamResult(out);
        SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
        try {
            TransformerHandler hd = tf.newTransformerHandler();
            Transformer serializer = hd.getTransformer();
            serializer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
            serializer.setOutputProperty(OutputKeys.INDENT, "yes");
            hd.setResult(streamResult);
            hd.startDocument();
            AttributesImpl atts = new AttributesImpl();
            hd.startElement("http://maul.ddm.apm.bpm.eds.com", "DTR_XML", "DTR_XML", atts);
            hd.endElement("http://maul.ddm.apm.bpm.eds.com", "DTR_XML", "DTR_XML");
            hd.endDocument();
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (TransformerConfigurationException e) {
            e.printStackTrace();
        }Here's the output I get:
<?xml version="1.0" encoding="ISO-8859-1"?>
<DTR_XML/>
And I'm looking for output like this (I think - basically I have this dtr_xml.xsd located at the root web directory on http://maul.ddm.apm.bpm.eds.com and I want the generated XML file to reference that schema for validation when parsing):
<?xml version="1.0" encoding="ISO-8859-1"?>
<DTR_XML xmlns="http://maul.ddm.apm.bpm.eds.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maul.ddm.apm.bpm.eds.com dtr_xml.xsd"/>

Yes, you've led me along the right track with the attributes stuff. Here's what I've got right now...
StreamResult streamResult = new StreamResult(out);
        SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
        try {
            TransformerHandler hd = tf.newTransformerHandler();
            Transformer serializer = hd.getTransformer();
            serializer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
            serializer.setOutputProperty(OutputKeys.INDENT, "yes");
            hd.setResult(streamResult);
            hd.startDocument();
            AttributesImpl atts = new AttributesImpl();
            atts.addAttribute("", "xmlns", "xmlns", "CDATA", "http://maul.ddm.apm.bpm.eds.com");
            atts.addAttribute("", "xsi", "xmlns:xsi", "CDATA", "http://www.w3.org/2001/XMLSchema-instance");
            atts.addAttribute("", "schemaLocation", "xsi:schemaLocation", "CDATA", "http://maul.ddm.apm.bpm.eds.com dtr_xml.xsd");
            hd.startElement("", "DTR_XML", "DTR_XML", atts);
            hd.endElement("", "DTR_XML", "DTR_XML");
            hd.endDocument();
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (TransformerConfigurationException e) {
            e.printStackTrace();
        }This produces the output I wanted earlier...
As for the org.xml.sax.helpers.NamespaceSupport, I can't seem to find any documentation on using it anywhere, and the javadoc is cryptic to me. Maybe it's used internally in SAX for tracking namespaces or something like that.
Another interesting thing to me is that if I use the code you gave:
atts.addAttribute("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation",
     "xsi:schemaLocation", "CDATA", "http://maul.ddm.apm.bpm.eds.com dtr_xml.xsd");I don't see "http://www.w3.org/2001/XMLSchema-instance" anywhere in the output. Is SAX ignoring the namespace uri argument? It appears so. The javadoc states that the uri argument is "The Namespace URI, or the empty string if none is available or Namespace processing is not being performed." It would appear that Namespace processing is not being done... but I don't know how to turn it on.

Similar Messages

  • Catch all error information while validating xml content with xsd schema

    Hi experts,
    I created a java mapping to validating the input xml content with xsd schema (schema validation). What I want is to catch all error message to the xml not just the first error. I used SAXParser in sapxmltoolkit.jar to do the schema validation. The below is a part of my java mapping.
    XMLReader parser = XMLReaderFactory.createXMLReader("com.sap.engine.lib.xml.parser.SAXParser");
    parser.setFeature( "http://xml.org/sax/features/validation" ,  true);
    parser.setFeature( "http://apache.org/xml/features/validation/schema" , true);
    parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");          parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",this.getClass().getClassLoader().getResourceAsStream(schema)); // schema is my schema name
    parser.setErrorHandler(new ParseErrorHandler()); // ParseErrorHandler is my own ErrorHandler which extends DefaultHandler
    parser.parse(new InputSource(new ByteArrayInputStream(sinput.getBytes())));
    // In error handler, I comment all code so as not to throw any exception
    public class ParseErrorHandler extends DefaultHandler
         public void error(SAXParseException e) throws SAXException
              // sSystem.out.println("Error" + e.getMessage());
              // throw e;
         public void fatalError(SAXParseException e)
              // throw e;
              // System.out.println("SAP Fatal Error" + e.getMessage());
    Unfortunately the program always stopped while catching the first error. Check the below log.
    com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException:
    ERRORS :
    cvc-simple-type : information item '/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]/:AddressInformation[1]/:CityName[1]' is not valid, because it's value does not satisfy the constraints of facet 'minLength' with value '1'.
    cvc-data : information item '/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]/:AddressInformation[1]/:CityName[1]' is is not valid with respoct to the corresponding simple type definition.
    cvc-element : element information item '/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]/:AddressInformation[1]/:CityName[1]' is associated with invalid data.
    cvc-element : element information item '/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]/:AddressInformation[1]' is not valid with respect to it's complex type definition..
    cvc-element : element information item '/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]' is not valid with respect to it's complex type definition..
    cvc-element : element information item '/:ShipNotice[1]/:Header[1]/:To[1]' is not valid with respect to it's complex type definition..
    cvc-element : element information item '/:ShipNotice[1]/:Header[1]' is not valid with respect to it's complex type definition..
    cvc-element : element information item '/:ShipNotice[1]' is not valid with respect to it's complex type definition..
    -> com.sap.engine.lib.xml.parser.ParserException:
    I tried using Xerces and JAXP to do validation, the same error happened. I have no idea on this. Does xi has its own error handler logic? Is there any body can make me get out of this?
    Thanks.

    <h6>Hi experts,
    <h6>
    <h6>I created a java mapping to validating the input xml content with xsd schema (schema validation). What I want is to catch all <h6>error message to the xml not just the first error. I used SAXParser in sapxmltoolkit.jar to do the schema validation. The below <h6>is a part of my java mapping.
    <h6>XMLReader parser = XMLReaderFactory.createXMLReader("com.sap.engine.lib.xml.parser.SAXParser");
    <h6>parser.setFeature( "http://xml.org/sax/features/validation" ,  true);
    <h6>parser.setFeature( "http://apache.org/xml/features/validation/schema" , true);
    <h6>parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");          <h6>parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",this.getClass().getClassLoader().getResourceAsStream(schema)); <h6>// schema is my schema name
    <h6>parser.setErrorHandler(new ParseErrorHandler()); // ParseErrorHandler is my own ErrorHandler which extends Default Handler
    <h6>parser.parse(new InputSource(new ByteArrayInputStream(sinput.getBytes())));
    <h6>
    <h6>// In error handler, I comment all code so as not to throw any exception
    <h6>public class ParseErrorHandler extends DefaultHandler
    <h6>{
    <h6>     public void error(SAXParseException e) throws SAXException
    <h6>     {
    <h6>          // sSystem.out.println("Error" + e.getMessage());
    <h6>          // throw e;
    <h6>     }
    <h6>
    <h6>     public void fatalError(SAXParseException e)
    <h6>     {
    <h6>          // throw e;
    <h6>          // System.out.println("SAP Fatal Error" + e.getMessage());
    <h6>
    <h6>     }
    <h6>
    <h6>}
    <h6>
    <h6>Unfortunately the program always stopped while catching the first error. Check the below log.
    <h6>
    <h6>com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException:
    <h6>ERRORS :
    <h6>cvc-simple-type : information item <h6>'/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]/:AddressInformation[1]/:CityName[1]' <h6>is not valid, because it's value does not satisfy the constraints of facet 'minLength' with value '1'.
    <h6>cvc-data : information item <h6>'/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]/:AddressInformation[1]/:CityName[1]' <h6>is is not valid with respoct to the corresponding simple type definition.
    <h6>cvc-element : element information item <h6>'/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]/:AddressInformation[1]/:CityName[1]' <h6>is associated with invalid data.
    <h6>cvc-element : element information item <h6>'/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]/:AddressInformation[1]' <h6>is not valid with respect to it's complex type definition..
    <h6>cvc-element : element information item <h6>'/:ShipNotice[1]/:Header[1]/:To[1]/:PartnerInformation[1]' <h6>is not valid with respect to it's complex type definition..
    <h6>cvc-element : element information item <h6>'/:ShipNotice[1]/:Header[1]/:To[1]' <h6>is not valid with respect to it's complex type definition..
    <h6>cvc-element : element information item <h6>'/:ShipNotice[1]/:Header[1]' <h6>is not valid with respect to it's complex type definition..
    <h6>cvc-element : element information item '/:ShipNotice[1]' is not valid with <h6>respect to it's complex type definition..
    <h6> -> com.sap.engine.lib.xml.parser.ParserException:
    <h6>
    <h6>
    <h6>I tried using Xerces and JAXP to do validation, the same error happened. I have no idea on this. Does xi has its own error <h6>handler logic? Is there any body can make me get out of this?
    <h6>Thanks.

  • Safari won't display XML content with an embedded stylesheet

    I'm using Safari 5.0.2 on Windows XP. I cannot get it to display an XML document with an embedded CSS stylesheet. The file in question appears in this ZIP file: http://www.hl7.org/documentcenter/ballots/2011JAN/downloads/CDAR2IG_SDISP_R1_D12011JAN.zip
    That document demonstrates is an attempt to enable display of standardized healthcare content in common web browsers. Can anyone here help?

    I have a separate bug report to Chrome on this one, same general result in display. The file is an XML document, not a CSS style-sheet. It contains an xml-stylesheet processing instruction that has a local URI #hl7-css-for-cda pointing to an element in the XML that contains the CSS stylesheet. That element uses xml:id to identify itself, so it is (according to the W3C) possible for the browser to determine that element as being the target of the URI.
    The problem appears to be that the Display Engine in Safari won't load the content of that URI as a CSS stylesheet.
    When I validate the CSS content in that XML element it returns as being valid CSS, and when I validate the XML using my XML editor, it is both well formed, and valid against the XML Schema appropriate to that file.

  • PL/SQL to generate XML compliant with an XSD

    Please excuse me if this has been asked elsewhere. I'm trying on Oracle 9.2 to output XML that will comply with a predefined schema. I've started out by creating various object types and an object view that matches the xml schema definition, and can use dbms_xmlgen.getxml to get out an xml document (a clob) without trouble, BUT I need to post-process this with shell scripts to add on the namespace information and amend the tags to put in the (e.g.) ns3: bit to identify which is the target namespace. It seems odd that I should need to do this - is there a better way? I have trawled all over rthe place but cannot find any mention of this requirement. Thanks for any help you might give me, I'm new to xml.

    Okay forget that, here's a quote from Oracle:
    "I'm the PM for XML DB, and our preferred direction for generating XML from data stored in relational tables is the industry standard SQL/XML operators. DBMS_XMLGEN will continue to be supported but most of our development efforts in terms of performance / feature improvements willl be targetted at the SQL/XML operators (XMLELEMENT(), XMLATTRIBUTES(), XMLAGG(), XMLFOREST() etc). In general they have proven to be much more flexible and performant, and easier to use "
    So it seems that the object-type/view route is dead in the water. Shame.

  • Form2xml generate xml files with "??????????" for non-latin characters

    i used form2xml in oracle 10 g suit to convert forms 5   .fmb to .xml . using the command:
    frmf2xml.bat OVERWRITE=YES myform.fmb
    The forms contains arabic character set, but the xml file is generated with character "????????? "  , and the xml file is unusable
    what can i do to keep arabic characters in the generated  xml files.
    Edit:
    I run form2xml on windows xp SP3 with arabic support (codepage =1256)
    The xml file is generated as UTF-8

    I resolved the problem.
    step1: search in the registry for every NLS_Lang key and modify its value to codepage 1256 using regedit
    step2: in control panel-Region and Language , I  modified language to be Arabic
    Now every thing is good

  • XML validation with an external Schema

    Hi all,
    i'm testing some EJBs under oc4j and I have problems validating some XML documents against an external Schema file.
    The code only uses JAXP classes and interfaces and it's already running with other application servers.
    The code is:
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
    "http://www.w3.org/2001/XMLSchema");
    The setAttribute method of the DocumentBuilderFactory throws an IllegalArgumentException meaning that this feature is not supported.
    Is that true?
    Someone knows another way to perform this validation without hardcoding Oracle libraries' specific code?
    Thanks
    F

    Hi all,
    i'm testing some EJBs under oc4j and I have problems validating some XML documents against an external Schema file.
    The code only uses JAXP classes and interfaces and it's already running with other application servers.
    The code is:
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    dbf.setNamespaceAware(true);
    dbf.setValidating(true);
    dbf.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
    "http://www.w3.org/2001/XMLSchema");
    The setAttribute method of the DocumentBuilderFactory throws an IllegalArgumentException meaning that this feature is not supported.
    Is that true?
    Someone knows another way to perform this validation without hardcoding Oracle libraries' specific code?
    Thanks
    F

  • Edit an XML file with SAX

    Dear all, I am so confused�.
    I have been trying for the last few days to understand how sax works� The only thing I understood is:
    DefaultHandler handler = new Echo01();
    SAXParserFactory factory = SAXParserFactory.newInstance();
            try {
                out = new OutputStreamWriter(System.out, "UTF8");
                SAXParser saxParser = factory.newSAXParser();
                saxParser.parse(file , handler);
            } catch (Throwable t) {
                t.printStackTrace();
            System.exit(0);
        }Ok, I assign the SAXParser the xml file and a handler. The parser parses and throws events that the handler catches. By implementing some handler interface or overriding the methods of an existing handler (e.g DeafultHandler class) I get to do stuff�
    But still, suppose I have implement startElement() method of DefaultHandler class and I know that the pointer is currently placed on an element e.g. <name>bob</name>. How do I get the value of the element, and if I manage to do that, how can I replace�bob� with �tom�?
    I would really appreciate any help given� just don�t recommend http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/ because although there are interesting staff in there, it does not solve my problem�

    Maybe SAX is not the right tool for you.
    With SAX, you implement methods like startElement and characters that get called as XML data is encountered by the parser. If you want to catch it or not, the SAX parser does not care. In your case, the "bob" part will be passed in one or more calls to characters. To safely process the data, you need to do something like build a StringBuffer or StringBuilder in the constructor of the class, and then in the startElement, if the name is one you want to read, set the length to zero. In the characters method, append the data to the StringBuilder or StringBuffer. In the endElement, do a toString to keep the data wherever you want.
    This works for simple XML, but may need to be enhanced if you have nested elements with string values that contain other elements.
    On the other hand, if your file is not huge, you could use DOM. With DOM, (or with JDOM, and I would expect with Dom4J -- but I have only used the first two) you do a parse and get a Document object with the entire tree. That allows you to easily (at least it is easy once you figure out how to do it) find a node like the "name" element and change the Text object that is its child from a value of "bob" to "tom". With DOM, you can then serialize the modified Document tree and save it as an XML file. SAX does not have any way to save your data. That burden falls to you entirely.
    Dave Patterson

  • How to generate xml file with multiple nodes using sqlserver as database in SSIS..

    Hi ,
    I have to generate the xml file using multiple nodes by using ssis and database is sqlserver.
    Can some one guide me on to perform this task using script task?
    sudha

    Why not use T-SQL for generating XML? You can use FOR XML for that
    http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
    http://visakhm.blogspot.in/2013/12/generating-nested-xml-structures-with.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Generating xml tags with stored procedure

    Hi Friends,
    I have to create a xml report using procedure .the code is given here to generate xml tags.
    create or replace procedure sri_xml (errbuff out varchar2,
    retcode out number) as
    /* create cursor to fetch the records*/
    cursor c_emp is select empno,
    ename,
    deptno,
    sal,
    job
    from emp;
    begin
    /* first line of xml data should be "<? xml version = "0.1"?>" */
    fnd_file.put_line(fnd_file.output,'<?xml version = "1.0" ?>');
    fnd_file.put_line(fnd_file.output,'<per_emp1>');
    for c in c_emp loop
    /* for each record create a group tag <gemp_name> at start */
    fnd_file.put_line(fnd_file.output,'<G_EMP_NAME>');
    /*EMBEDD DATA BETWEEN XML TAGS */
    fnd_file.put_line(fnd_file.output,'<empno>' || c.empno || '</empno>');
    fnd_file.put_line(fnd_file.output,'<ename>' || c.ename || '</ename>');
    fnd_file.put_line(fnd_file.output,'<sal>' || c.sal || '</sal>');
    fnd_file.put_line(fnd_file.output,'</G_EMP_NAME>');
    end loop;
    fnd_file.put_line(fnd_file.output,'</per_emp1>');
    end;
    i run the procedure in the concurrent program with output mode as text and i got the xml tags as the out put. i have created the template using the data definition and registered them in the xml publisher administer but i am unable to get the out put when i run the concurrent request it is giving the message "AUTHENTICATION FAILED".
    please help me to solve the problem and to get the desired output with desired template.
    thanks in advance,
    siddam

    Hi Siddam,
    Please post your query on BI Publisher forum.
    There are number of folks who can resolve the issue u faced.
    Please go through the bi publisher developers guide and then design the report.
    I am not sure about the process ur following for report development...i think you have to create data defination and rtf layout and then attach it to oracle xml administrator responsibility.
    Ratnesh

  • Validating generated XML file with DTD

    Hello all,
    my requirement is to test the XML file with its DTD.
    we are creating an XML file, before writing it on the application server , we need to test it with its DTD.
    i found one method set_validating in the interface if_ixml_parser , for validating XML file, but not getting an idea how to use it, like how to link the DTD to XML etc.
    if i try to use the above method am getting the following error:
    Unable to retrieve the external entity 'd:\dtdfile.dtd'.
    where 'd:\dtdfile.dtd' is the path of the DTD file included in the Doctype of the XML file.
    Please help me to solve this.
    Thx in advance.

    Hello,
    Did you find your answer ?
    I know how to validate an XML file an internal DTD, but not an external one... If you know, can you pelase advice ?
    If you didn't found yet, you need to use method get_reason() to get the description of the error.
    best regards,
    Gilles.

  • How to Create XML file with SAX parser instead of DOM parser

    HI ALL,
    I am in need of creating an XML file by SAX parser ONLY. As far as my knowledge goes, we can use DOM for such purpose(by using createElement, creatAttribute ...). Can anyone tell me, is there any way to create an XML file using SAX Parser only. I mean, I just want to know whether SAX provides any sort of api for Creatign an element, attribute etc. I know that SAX is for event based parsing. But my requirement is to create an XML file from using only SAX parser.
    Any help would be appreciated
    Thanx in advance
    Kaushik

    Hi,
    You must write a XMLWriter class yourself, and that Class extends DefaultHandle ....., the overwrite the startElement(url, localName, qName, attributeList), startDocument(), endElement().....and so on.
    in startElement write your own logic about how to create a new element and how to create a Attribute list
    in startDocument write your own logic about how to build a document and encodeType, dtd....
    By using:
    XMLWriter out = new XMLWriter()
    out.startDocument();
    Attribute attr1 = new Atribute();
    attr1.add("name", "value");
    out.startElement("","","Element1", attr1);
    Attribute attr2 = new Atribute();
    attr2.add("name", "value");
    out.startElement("","","Element2", attr2);
    out.endElement("","","Element2");
    out.endElement("","","Element1");
    out.endDocument();

  • Reading xml file with sax parser: unknown protocol: c

    Hi,
    I've been googling around, and the best I can find is that the file name:
    File test = new File("lib/test/parseTest/validate-test.xml");should be a url:
    File test = new File("File://lib/test/parseTest/validate-test.xml");but I'm working on a linux machine and can't put "File://c:/pathToFile/file.xml"
    Also, I did some testing and I can read a small xml file with just a few elements, but on large complex files, I get that error.
    anyone ever run into this before?
    bp
    Edited by: badperson on Nov 1, 2008 2:19 PM

    badperson wrote:
    I've been googling around, and the best I can find is that the file name:
    File test = new File("lib/test/parseTest/validate-test.xml");should be a url:
    File test = new File("File://lib/test/parseTest/validate-test.xml");
    No, that's wrong. The parameter for that constructor is a file path (relative or absolute). Not a URL. You must have misunderstood whatever you read.
    but I'm working on a linux machine and can't put "File://c:/pathToFile/file.xml"What kind of a Linux machine is this which has a C drive? You must have misunderstood whoever told you to do that.

  • XML output with UTF8 Encoding scheme

    In external partner wants that we provide him an XML file with data, encoded in UTF8 format.
    Using the SQL/XML functions I can construct the XML with the structure (shcema) he asks for.
    But how can I guarantee that my XML-output is in UTF8, because our oracle database has been built in the default character set WE8ISO8859PI.
    I suppose it is not enough to add in front off my document: <?xml version="1.0" encoding="UTF8"?> ?

    Jan,
    You may want to check on metalink for WE8iso8859P1 to see if it is a subset of UTF8. There are some documents on metalink that discuss the UTF8 character set and ways to pull differenct character sets and conversion from the database depending on what is stored in the database, or changing the database character set to UTF8.
    Have you tried a test extract to see if the characters are correct?

  • Writing contents of XML-documents with SAX

    I have the following problem: I use the SAX-API for parsing an XML- document and to write the contents of several tags into field variables.
    For that, I use the method 'characters(char cbuf[], int start, int len' and read the interesting string part
    'new String(cbuf,start,len) where cbuf is the character buffer, start the offset in the file and len the length of the string within the tag.
    I registered the following problem if I load my application from a jar-file (with a 13kb long xml-file):
    The offset runs till 8192 bytes and then resets to 1 and runs up again. If it reaches the offset 8192 bytes (8Kbyte) within a string as content of a tag, the string is split into two: the first till this offset and the second after it.
    I have already tried to solve this problem by setting some features of the SAX-parser but I had no success.
    The problem does not occur if I start my application from the Oracle-JDeveloper.
    Is there anyone who has an idea? I am glad about any information or hint which might a help for me.
    Thank you.

    From the javadocs for org.xml.sax.ContentHandler.characters(char[] ch,
    int start,
    int length)
    The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
    To get around this.
    - Initialize a StringBuffer field in startElement().
    characters = new StringBuffer();- Each time characters() is called, append the section of the char[] to the StringBuffer.
    characters.append(buf, offset, len);- Work with the entire resulting value in endElement().
    -Scott
    http://www.swiftradius.com

  • Validating parser with SAX and SCHEMA

    Hi,
    Can I validate a xml file by SCHEMA with Sun's SAX?
    If i can, what versions i need?
    jsdk1.3 and SAX 1.0 are enought ?
    What is JAXP , it's a SAX version ?
    Thanks.
    Sorry for my english !

    I tried this doc with the file source, but it does't work, i have the error message following :
    java.lang.IllegalArgumentException: No attributes are implemented
    Download the latest copy of JAXP from http://java.sun.com
    ERROR! INVALID FILE
    But I have JAXP installed with JavaTM XML Pack, and I didn't change the source, juste copy on my hard disk and run the .java.
    Why do I have this errors ? please.

Maybe you are looking for

  • Unable to get the admin object for the CsContainerAdmin service

    Hi, On AIX, we deployed XIR2 SP2 --> XIR2 SP3 --> SP3 Productivity Pack. The Conection server does show up on the server list in the CMC, but on trying to access this server, it throws an error" Unable to get the admin object for the CsContainerAdmin

  • How to publish a file as secure content, i.e https: ??

    https: ??

  • PDF not attaching to Outlook using Adobe Reader

    When clicking the Mail icon on the tool bar in adobe reader to attach the PDF to an email, adobe reader freezes and the document does not attach. It does work if Outlook 2013 is closed but if Outlook 2013 is open adobe reader just freezes for a minut

  • Urgent select with complex requirement

    Dear all I have two columns in al table its data is like the following example : stuff description desk is red with glass desk is rounded desk having four legs chair its color is brown this is how the data in the table what i want is to select from t

  • Dynamic Vlan assignment by Mac address SF300-48P

    We are trying to configure a Cisco SF300-48P so that when we plug in a specific manufactures device the port is set to a specific VLAN. We have configured mac address groups and assigned the groups to the required VLANs but when we plug the devices i