Question about XML DOM de-bugging.

I have programmed the following class as an excercise in using the DOM and in recursion.
I'm having trouble,however, in debugging my iterate() method.
Sometimes it fails to print certain outer tags.
I'm faily confident there aren't any problems in using entirely static methods in the class.
I simply want it to iterate over all Nodes in the xml document,
and print them to the file in correct order.
Is there anyone out there who could debug my iterate() method?
import org.w3c.dom.*;
import javax.xml.parsers.*;
import java.io.*;
public class DomParsing {
private static PrintStream stream;
public static void main (String [] args)
try
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = builderFactory.newDocumentBuilder();
File file = new File("cd-catalog.xml");
Node child = null;
Document document = builder.parse(file);
Node element = (Node)document.getDocumentElement();
stream = new PrintStream(new File("SCREEN_OUTPUT.txt"));
iterate(element);
stream.close();
catch (Exception e)
{e.printStackTrace();}
public static void iterate(Node element) //bug in this method.
if(element instanceof Node)
peekNode(element);
peekAttributes(element);
Node [] children = getChildren(element);
if(children instanceof Node[])
for(int i=0;i<children.length;i++)
iterate(children);
element = getSibling(element);
if(element instanceof Node)
iterate(element);
else {
return;}
private static Node [] getChildren(Node element)
Node [] children = null;
if(element.hasChildNodes()){
NodeList nodes= element.getChildNodes();
children = new Node [nodes.getLength()];
for(int i=0;i<nodes.getLength();i++)
{children[i] = nodes.item(i);}
return children;}
private static Node getSibling(Node element)
return element.getNextSibling();}
private static void peekNode(Node node)
if((node instanceof Node) && (stream instanceof PrintStream))
if(node.getNodeName()!=null && (!node.getNodeName().equals("#text")))
{stream.println(new String(node.getNodeName()));
if(node.getNodeValue()!=null)
{stream.println(new String(node.getNodeValue()));
private static void peekAttributes(Node element)
if(element.hasAttributes())
NamedNodeMap map = element.getAttributes();
for(int i=0;i<map.getLength();i++)
Attr attribute = (Attr)map.item(i);
peekNode((Node)attribute);}

Never fear, Ihave found my answer!
I had unwitingly disasociated recursive steps,
instead of correctly associated.
The following runs correctly in
all my instances:
   import org.w3c.dom.*;
   import javax.xml.parsers.*;
   import java.io.*;
   import java.util.*;
    public class DomParsing {
    //Main method call to leverage the Iterator Class.
       public static void main (String [] args)
         Iterator iterator = new Iterator("tomcat-users.xml");
    class Iterator {
      private LinkedList<String> myDocument;
      //private  PrintStream stream; 
        //Constructor accesses xml file for parsing work.
       public Iterator (String fileName)
         try{
            DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = builderFactory.newDocumentBuilder();
            File file = new File(fileName);
            Node child = null;
            Document document = builder.parse(file);
            Node element = (Node)document.getDocumentElement();
            //stream = new PrintStream(new File("SCREEN_OUTPUT.txt"));
            myDocument = new LinkedList<String>();
            System.out.println("___________________________________________________");
            iterate(element);  
           //stream.close();               
            ListIterator<String> nodes = myDocument.listIterator();
            while(nodes.hasNext())
               System.out.println(nodes.next().trim());
            System.out.println("___________________________________________________");
             catch (Exception e)
            {e.printStackTrace();}
      //This method is intended to be called recursively
        //to set up a "tree" arrangement in memory
        //representing an xml document tree.
       private void iterate(Node element)       {
         if (element == null)
            return;
         if(element instanceof Node)
            peekNode(element);
            peekAttributes(element);
            Node [] children = getChildren(element);
            if(children instanceof Node[])
               for(int i=0;i<children.length;i++)
                  iterate(children);
Node sibling = getSibling(element);
if(sibling instanceof Node)
{iterate(sibling);}
//Returns array of all Children Nodes of an Element.
private Node [] getChildren(Node element)
Node [] children = null;
if(element.hasChildNodes()){
NodeList nodes= element.getChildNodes();
children = new Node [nodes.getLength()];
for(int i=0;i<nodes.getLength();i++)
{children[i] = nodes.item(i);}
return children;}
//Obtains the next Sibling element
private Node getSibling(Node element)
return element.getNextSibling();}
     //These print any Node and any data,
     //from Element,attribute,attribute values,
     //sibling,child, etc..
private void peekNode(Node node)
if((node instanceof Node))// && (stream instanceof PrintStream))
if(node.getNodeName()!=null && (!node.getNodeName().equals("#text")))
{//stream.println(new String(node.getNodeName().trim()));
myDocument.add(node.getNodeName().trim());
//System.out.println(node.getNodeName().toString());
if(node.getNodeValue()!=null)
{//stream.println(new String(node.getNodeValue().trim()));
myDocument.add(node.getNodeValue().trim());
//System.out.println(node.getNodeValue().toString());
     //This examines the xml attributes on and element node.
private void peekAttributes(Node element)
if(element.hasAttributes())
NamedNodeMap map = element.getAttributes();
for(int i=0;i<map.getLength();i++)
Attr attribute = (Attr)map.item(i);
peekNode((Node)attribute);}

Similar Messages

  • Question about XML validation against schema

    My question is probably a basic one about XML. I tried PurchaseOrder example from the book "J2EE Web Services" by Richard Monson-Haefel. A simplified version as followings -
    Address.xsd -
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xml.netbeans.org/schema/Address"
    xmlns:addr="http://xml.netbeans.org/schema/Address"
    elementFormDefault="qualified">
    <element name="address" type="addr:USAddress" />
    <complexType name="USAddress">
    <sequence>
    <element name="name" type="string" />
    <element name="street" type="string" />
    <element name="city" type="string" />
    <element name="state" type="string" />
    <element name="zip" type="string" />
    </sequence>
    </complexType>
    </schema>
    PurchaseOrder.xsd -
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://xml.netbeans.org/schema/PurchaseOrder"
    xmlns:po="http://xml.netbeans.org/schema/PurchaseOrder"
    xmlns:ad="http://xml.netbeans.org/schema/Address"
    elementFormDefault="qualified">
    <import namespace="http://xml.netbeans.org/schema/Address" schemaLocation="Address.xsd" />
    <element name="purchaseOrder" type="po:PurchaseOrder" />
    <complexType name="PurchaseOrder">
    <sequence>
    <element name="accountName" type="string" />
    <element name="accountNumber" type="unsignedShort" />
    <element name="shipAddress" type="ad:USAddress" />
    <element name="total" type="float" />
    </sequence>
    <attribute name="orderDate" type="date" />
    </complexType>
    </schema>
    Then PurchaseOrder.xml is -
    <purchaseOrder orderDate="2007-12-12"
    xmlns='http://xml.netbeans.org/schema/PurchaseOrder'
    xmlns:addr="http://xml.netbeans.org/schema/Address"
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xsi:schemaLocation='http://xml.netbeans.org/schema/PurchaseOrder ../xsd/PurchaseOrder.xsd'>
    <accountName>Starwood</accountName>
    <accountNumber>220</accountNumber>
    <shipAddress>
    <name>Data Center</name>
    <street>1501 Washington St.</street>
    <city>Braintree</city>
    <state>MA</state>
    <zip>02148</zip>
    </shipAddress>
    <total>250</total>
    </purchaseOrder>
    Then I did a XML validation but have this error -
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'name'. One of '{"http://xml.netbeans.org/schema/Address":name}' is expected. [19]
    It complains <name> tag in <shipAddrss> needs namespace of "http://xml.netbeans.org/schema/Address". Why?
    Is it possible to change XML so it does not need name space for elements inside <shipAddress>?
    Thanks

    Hi Madhura,
    see here my comparison of the web version against the local file version on my Windows box (which is itself not the fastest): It makes a factor 16 in difference!
    C:\Temp\xsdvalidator>java XsdValidator madhu.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 16353 ms
    C:\Temp\xsdvalidator>java XsdValidator madhu_local.xsd madhu.xml
    cvc-pattern-valid: Value 'provamail.it' is not facet-valid with respect to patte
    rn '[^@]+@[^.]+[.].+' for type 'EmailType'.
    NOK - Validation error
    Elapsed time: 994 ms
    Obviously, the w3c.org domain that you specified as ressource location is very slow - and, as the FAQ shows, this delay is intentional!
    The W3C servers are slow to return DTDs. Is the delay intentional?
    Yes. Due to various software systems downloading DTDs from our site millions of times a day (despite the caching directives of our servers), we have started to serve DTDs and schema (DTD, XSD, ENT, MOD, etc.) from our site with an artificial delay. Our goals in doing so are to bring more attention to our ongoing issues with excessive DTD traffic, and to protect the stability and response time of the rest of our site. We recommend HTTP caching or catalog files to improve performance.
    --> They don't want to have requests to their site from productive servers all around the world.
    Regards,
    Rüdiger

  • Question about xml schemas and the use of unqualified nested elements

    Hello,
    I have the following schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns="http://xml.netbeans.org/examples/targetNS"
        targetNamespace="http://xml.netbeans.org/examples/targetNS"
        elementFormDefault="unqualified">
        <xsd:element name="name" type="xsd:string"/>
        <xsd:element name="age" type="xsd:int"/>
        <xsd:element name="person">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="name"/>
                    <xsd:element ref="age"/>
                   <xsd:element name="height" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>I am just wondering why would someone have a nested element that is unqualified? here the "height" element.
    Can anyone explain this to me please?
    Thanks in advance,
    Julien.
    here is an instance xml document
    <?xml version="1.0" encoding="UTF-8"?>
    <person xmlns='http://xml.netbeans.org/examples/targetNS'
      xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
      xsi:schemaLocation='http://xml.netbeans.org/examples/targetNS file:/E:/dev/java/XML/WebApplicationXML/web/newXMLSchemaThree.xsd'>
    <name>toto</name>
    <age>40</age>
    <height>180</height>
    </person>

    Don't worry about it.
    There are two different styles of schemas. In one style, you define the elements, attributes, etc. at the top, and then use the "ref" form to refer to them. (I call this the "global" style.) The other style is to define elements inline where they are used. ("local" style)
    Within some bounds, they work the same and which you use is a choice of you and the tools that generate the schemas.
    A warning about the local style. It is possible to define an element in two different locations in the schema that are different. It will get past all schema validation, but it seems wrong to my sense of esthetics. With the global style, this will not happen.
    So, how did this happen? Probably one person did the schema when it only had a name and age. Then, someone else added the height element. They either used a different tool, or preferred the other style. I'm aware of no difference in the document you have described between the two styles.
    Dave Patterson

  • Somple question about xml structure

    xml file is :
    <?xml version="1.0" encoding="UTF-8"?>
    <properties>
         <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
    </category>
    </properties>
    and want to use DOM in java to get the nodelist information,
    Element root=doc.getDocumentElement();
    NodeList nodelist = root.getChildNodes();
    for(int i = 0;i<nodelist.getLength();i++)
    System.out.println(nodelist.tostring());
    System.out.println(nodelist.getLength());
    System.out.println(nodelist.getNodeType());
    but the output is:
    <properties>
         <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
         </category>
    </properties>
    3 //why here the nodelist.length is 3?which 3?
    3
    <properties>
         <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
         </category>
    </properties>
    3
    1
    <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
         </category>
    5 //why is 5? which 5?
    3
    <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
         </category>
    5
    1
    <timeout>60</timeout>
    1 //here is just 1?
    3
    <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
         </category>
    5
    3
    <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
         </category>
    5
    1
    <timeout>100</timeout>
    1
    3
    <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
         </category>
    5
    3
    <properties>
         <category>
              <timeout>60</timeout>
              <timeout>100</timeout>
         </category>
    </properties>
    3
    3
    why all the node.getNodeType is 3, 3 means that they are all Text type?
    thanks

    some wrong.sorry
    the code is :
    Element root=doc.getDocumentElement();
    NodeList nodelist = root.getChildNodes();
    for(int i = 0;i<nodelist.getLength();i++)
    System.out.println(nodelist.item(i).tostring());
    System.out.println(nodelist.item(i).getLength());
    System.out.println(nodelist.item(i).getNodeType());
    }

  • Question about XML mapping to ABAP internal table

    Hi experts.
    I'm trying to XML mapping. But it doesn't work well. Assume there are XML file as below.
    <HEADER>
      <ITEM>
        <FOO>123</FOO>
        <BAR>ABC</BAR>
      </ITEM>
      <ITEM>
        <FOO>456</FOO>
        <BAR>DEF</BAR>
      </ITEM>
    <HEADER>
    and I want to trasformation it as below.
    ITAB
    FOO       |      BAR
    123         |  ABC
    456         | DEF
    How could I trasformation using "call transformation"?
    Regards.

    Hi,
    REPORT  zind_xml_to_sap NO STANDARD PAGE HEADING.
    Data Declaration                                                    *
    DATA: client      TYPE REF TO if_http_client, "Interface
          host        TYPE string,
          port        TYPE string,
          proxy_host  TYPE string,
          proxy_port  TYPE string,
          path        TYPE string,
          scheme      TYPE i,
          xml         TYPE xstring,
          response    TYPE string.
    DATA: t_xml       TYPE smum_xmltb OCCURS 0 WITH HEADER LINE.  "XML Table structure used
                                                                  "for retreive and output XML doc
    DATA: g_stream_factory TYPE REF TO if_ixml_stream_factory.    "Interface
    DATA : return  LIKE  bapiret2 OCCURS 0 WITH HEADER LINE.      "XML Table structure used for retreive
                                                                  "and output XML doc
    Parameters                                                          *
    PARAMETER : p_add TYPE string LOWER CASE ,
                p_dfile   LIKE rlgrap-filename.
    AT Selection-Screen on value-request for file                       *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dfile.
    Get file
      PERFORM 100_get_file.
    Start-of-Selection                                                  *
    START-OF-SELECTION.
    Perform to upload xml data from URL to SAP internal table
      PERFORM 200_xml_upload.
      IF t_xml[] IS NOT INITIAL.
      Perform to Download data from Internal Table to a text file in local drive
        PERFORM 300_download.
        write : / 'Data Uploaded to Internal Table Successfully'.
        write : / 'XML Data Downloaded to Local path', p_dfile.
      else.
        write : / 'No Data for upload'.
      ENDIF.
    *if t_xml[] is INITIAL.
    WRITE : address, 'Given URl cannot be Converted' .
    else.
    LOOP AT t_xml .
       WRITE:  t_xml-cname, t_xml-cvalue.
    ENDLOOP.
    endif.
    *&      Form  get_file
          Get File
    FORM 100_get_file .
      CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
        FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_dfile
    ENDFORM.                    " 100_get_file
    *&      Form  200_xml_upload
          form to upload xml data from URL to SAP internal table
    FORM 200_xml_upload .
    *Check HTTP:// and concatenate
      IF p_add NS 'http://' OR p_add NS 'HTTP://'.
        CONCATENATE 'http://' p_add
                    INTO p_add.
      ENDIF.
    Fetching the address of the URL
      CALL METHOD cl_http_client=>create_by_url
        EXPORTING
          url    = p_add
        IMPORTING
          client = client.
    *Structure of HTTP Connection and Dispatch of Data
      client->send( ).
    *Receipt of HTTP Response
      CALL METHOD client->receive
        EXCEPTIONS
          http_communication_failure = 1
          http_invalid_state         = 2
          http_processing_failed     = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        IF sy-subrc = 1.
          MESSAGE 'HTTP COMMUNICATION FAILURE' TYPE 'I' DISPLAY LIKE 'E'.
          EXIT.
        ELSEIF sy-subrc = 2.
          MESSAGE 'HTTP INVALID STATE' TYPE 'I' DISPLAY LIKE 'E'.
          EXIT.
        ELSEIF sy-subrc = 3.
          MESSAGE 'HTTP PROCESSING FAILED' TYPE 'I' DISPLAY LIKE 'E'.
          EXIT.
        ELSE.
          MESSAGE 'Problem in HTTP Request' TYPE 'I' DISPLAY LIKE 'E'.
          EXIT.
        ENDIF.
      ENDIF.
    Get data of the xml to Response
      response = client->response->get_cdata( ).
    *FM converting the XML format to abap
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          text   = response
        IMPORTING
          buffer = xml.
    *FM converting XMl to readable format to a internal table.
      CALL FUNCTION 'SMUM_XML_PARSE'
        EXPORTING
          xml_input = xml
        TABLES
          xml_table = t_xml
          return    = return.
    ENDFORM.                    " 200_xml_upload
    *&      Form  300_download
    *form to Download data from Internal Table to a text file in local drive
    FORM 300_download .
      DATA filename TYPE string.
      filename = p_dfile.
      CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
        filename                        = filename
        WRITE_FIELD_SEPARATOR           = 'X'
      TABLES
        data_tab                        = t_xml
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
      IF sy-subrc <> 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.

  • Question about XML file transferring over the networking

    Hi, I am now to Java, and now I am going to set up a simple network in the lab.
    I have created a random array of data and transferred to XML file on my client. Now, I would like to send it to the server. I am wondering how I can put the XML file into my client, and do I need any parser to let the server show what random date it has received?
    Anybody can give me any idea or some basic code? Thank you.
    Now, I am referring the KnockKnock example in Java online tutorial. But, not clear how to deal with the XML File.
    Fengyuan

    Four crossposts.
    http://forum.java.sun.com/thread.jspa?threadID=5158198&messageID=9600070#9600070
    http://forum.java.sun.com/thread.jspa?threadID=5158200&messageID=9600074#9600074
    http://forum.java.sun.com/thread.jspa?threadID=5158201&messageID=9600076#9600076
    http://forum.java.sun.com/thread.jspa?threadID=5158202&messageID=9600078#9600078

  • General question about xml

    Hi,
    How can I "include" xml file to another xml file?
    I want to different in one xml file some header reports...for once!!!
    then to call (include) from all athers xml files to this header.
    (instead all the time to write the same rows.. :))
    Thanks.
    I'm new in xml topic.

    XSLT seems to be your choice, but standard API's can also be used for this purpose.

  • Question about User Accounts and bugs

    Hello!
    I'm a developer and just started this iPhone app project so I'm not really experienced with all this cocoa/Mac/iPhone world yet.
    The thing is: I'm having this crash on the app running on the simulator, but this ONLY happens with my main user account. Doesn't happen on the device, on another account on the same computer or my coworkers computers.
    I haven't found what's causing this, so I'm thinking about deleting my account and recreating it.
    Is deleting an user account like formatting it?
    Is there anything that I could try before deleting it? Like restoring permissions or the OS with the dvd... These are things that I read about Mac Support.
    Any ideas?

    roam wrote:
    Is deleting an user account like formatting it?
    No, deleting it removes it. Like, put in the trash and then empty it.
    Importantly you should create a new user account with Admin privileges and from that new account delete the older one. Doing it this way still leaves you with Admin control of your computer.
    Before you delete an account... as to your particular problem, there are particular forums concerned with application development. Click on the link below for more specialized forums regarding iPhone app development and your coding error.
    http://discussions.apple.com/category.jspa?categoryID=164
    Yeah, I created another account with Admin privileges, I'm just reluctant to the idea of having to config everything again in the new account. I tried Stack Overflow and iPhoneDevSDK, will try the Apple's forum now.
    Thanks mate.

  • Question about XML

    HI, it is pobible that i can do bindings between two XML
    objects???

    That's not possible because data binding requires events to
    be fired and XML does not implement IEventDispatcher nor does it
    extend EventDispatcher. When you write data binding code, the Flex
    compiler generates code which dispatches and listens for events to
    actually do the data binding.

  • Question about Audigy 4 and bug report regarding the THX-cons

    Will there be a non-pro version of the Audigy 4 and when?
    The THX-console doesn't remember its settings when I switch from one speaker config to another. This is pretty annoying since I use both a hi-fi system and headphones.
    Could you fix this please?
    Thanks!

    thanks for info. Sorry I didn't post this earlier but the slider has corrected itself. Also the is probably being used by the os

  • Question about validating xml against schema

    Hi,
    I am new to JAXP. I try to validating a xml against a schema. I wrote following code:
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespace(true);
    spf.setValidating(true);
    SAXParser sp = spf.newSAXParser();
    sp.setProperty("http://java.sun.com/xml/properties/jaxp/schemaLanguage",
    "http://www.w3.org/2001/XMLSchema");
    sp.setProperty("http://java.sun.com/xml/properties/jaxp/schemaSource",
    "mySchema.xsd") ;
    sp.parse(<XML Document>, <ContentHandler);
    but when compile, it has error: can't resolve ""http://java.sun.com/xml/properties/jaxp/schemaLanguage", and
    "http://java.sun.com/xml/properties/jaxp/schemaSource".
    It seems it didn't support above two property.
    I saw some code in forum is:
    fact.setFeature("http://xml.org/sax/features/validation", true);
    fact.setFeature("http://apache.org/xml/features/validation/schema",true);
    fact.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    SAXParser sp = fact.newSAXParser();
    sp.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schemas);
    Why sun tutorial use property:http://java.sun.com/xml/properties/jaxp/schemaLanguage
    and someone use:http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation
    where to get information about setting properties for SAXParserFactory?
    Thanks

    In the past, ColdFusion's XML validation mechanism seems to have had issues with schemas that contain imports, e.g., http://forums.adobe.com/message/155906. Have these issues still not been resolved?
    Do you not think that perhaps you're answering your own question here?
    I don't see an issue about this on the bug tracker.  It might be an idea if you can get a simple, stand-alone repro case together and raise an issue (and post the reference back here and against that other thread so people know to vote for it).  If you post the repro case here too, it would be helpful.
    Adam

  • Bug in XML DOM

    there is a bug in XML DOM API in Safari for Windows. The same bug was in FireFox 2 https://bugzilla.mozilla.org/show_bug.cgi?id=206053
    Hmm... how to report it to Apple?

    You should use the following function instead:
    public NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
    java.lang.String localName)

  • Miscellanous questions about BDB XML

    Hi !
    I'm in search for a storage solution for a Matlab app that manipulates big volumes of datas (several Gb), and so can't load them fully in memory without crashing. I also can't load / unload them each time I need a bit of these data, since it is rather long to load a file in memory (about 0.12s). So I was thinking about using a DMB like BDB XML, and I have a few questions about it :
    <ul><li>What about performances to create a 3-5Gb database in a single batch ?</li>
    <li>What about performances to excecute a XQuery request on a db this large ? Longer or shorter than loadin directly the file in memory ? With an index or without ?
    </li>
    <li> No matlab integration is provided, so I have to way : use Matlab C integration to make an interface to use BDB XML, or using the shell via an exec like command to interact with BDB ? Is the shell trick performant ? Or does it spend a lot of time parsing the input ?</li>
    </ul>
    Thanks for those who will take a bit of their precious time to answer my questions !

    Hello,
    I'm in search for a storage solution for a Matlab app that manipulates big volumes of datas (several Gb), and so can't load them fully in memory without crashing. I also can't load / unload them each time I need a bit of these data, since it is rather long to load a file in memory (about 0.12s). So I was thinking about using a DMB like BDB XML, and I have a few questions about it :
    <ul><li>What about performances to create a 3-5Gb database in a single batch ?</li>It will take a while. If you bulk load you should avoid using transactions and sync/exit the environment when you are done. Note that you should determine what indexes you might want/need before doing the load and create them. Reindexing 5GB of data will take another really large chunk of time. I recommend experimentation with indexes, queries and a small representative subset of the data.
    Be sure to create a node storage container with nodes indexed.
    Is this one document or many? Many is better. One 5Gb document is less than ideal but will work.
    <li>What about performances to excecute a XQuery request on a db this large ? Longer or shorter than loadin directly the file in memory ? With an index or without ?You really need indexes. The query will likely succeed without indexes but depending on the query and the data could take a very long time. See above on experimentation first.
    </li>
    <li> No matlab integration is provided, so I have to way : use Matlab C integration to make an interface to use BDB XML, or using the shell via an exec like command to interact with BDB ? Is the shell trick performant ? Or does it spend a lot of time parsing the input ?</li>There is no C interface, just C++. I would not recommend using the dbxml shell for this although you could if you really need to.
    Let the group know how this turns out.
    Regards,
    George

  • Question about dependent projects (and their libraries) in 11g-Oracle team?

    Hello everyone,
    I have a question about dependent projects. An example:
    In JDeveloper 10.1.3.x if you had for instance 2 projects (in a workspace): project 1 has one project library (for instance a log4j library) and project 2 is a very simple webapplication which is dependent on project 1. Project 2 has one class which makes use of log4j.
    This compiles fine, you can run project 2 in oc4j, and the libraries of project 1 (log4j) are added on the classpath and everything works fine. This is great for rapid testing as well as keeping management of libraries to a minimum (only one project where you would update a library e.g.)
    However in 11g this approach seems not to work at all anymore now that weblogic is used, not even when 'export library' is checked in project 1. The library is simply never exported at all - with a noclassdeffound error as result. Is this approach still possible (without having to define multiple deployment profiles), or is this a bug?
    Thanks!
    Martijn
    Edited by: MartijnR on Oct 27, 2008 7:57 AM

    Hi Ron,
    I've tried what you said, indeed in that .beabuild.txt when 'deploy by default' is checked it adds a line like: C:/JDeveloper/mywork/test2/lib/log4j-1.2.14.jar = test2-view-webapp/WEB-INF/lib/log4j-1.2.14.jar
    Which looks fine, except that /web-inf/lib/ is empty. I presume its a sort of mapping to say: Load it like it in WEB-INF/lib? This line is not there when the deploy by default is not checked.
    I modified the TestBean as follows (the method that references Log4j does it thru a Class.forName() now only):
    public String getHelloWorld() {
    try {
    Class clazz = Class.forName("org.apache.log4j.Logger");
    System.out.println(clazz.getName());
    catch(Exception e) {
    e.printStackTrace();
    return "Hello World";
    In both cases with or without line, it throws:
    java.lang.ClassNotFoundException: org.apache.log4j.Logger
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:176)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:42)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at nl.test.TestBean.getHelloWorld(TestBean.java:15)
    Secondly I added weblogic.xml with your suggested code, in the exploded war this results in a weblogic.xml which looks like:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app.xsd" xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
    <container-descriptor>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    <jsp-descriptor>
    <debug>true</debug>
    <working-dir>/C:/JDeveloper/mywork/test2/view/classes/.jsps</working-dir>
    <keepgenerated>true</keepgenerated>
    </jsp-descriptor>
    <library-ref>
    <library-name>jstl</library-name>
    <specification-version>1.2</specification-version>
    </library-ref>
    <library-ref>
    <library-name>jsf</library-name>
    <specification-version>1.2</specification-version>
    </library-ref>
    </weblogic-web-app>
    The only thing from me is that container-descriptor tag, the rest is added to it during the deployment. Unfortunately, it still produces the same error. :/ Any clue?

  • BDB XML DOM Implementation

    Hi all---
    I have some newbie questions about BDB/XML's DOM Implementation and its interaction with Xerces-c.
    We are trying to deploy BDB/XML underneath our current database abstraction layer. The application makes use of Xerces-c and the abstraction layer query/get interfaces return objects of type Xercesc-XXXX::DOMDocument*. I can easily get documents out of BDB/XML and return the DOM to the upper layer by use of the XmlDocument::getContentAsDOM() interface.
    The problem occurs as the upper application layers start to manipulate the Document. For instance, in order to print the document, some code creates a serializer (DOMWriter) using Xerces-c, but when applied to the Document returned by BDB/XML the serializer corrupts the DOM and we get an ugly crash.
    I'm completely new to the intricacies/compatibility issues between DOM implementations---is what I am describing here supported in theory? Or is there a fundamental problem---some incompatibility between a Xerces-c DOMWriter and a BDB/XML DOMDocument?
    fwiw, the error appears to be caused by the Xerces-c memory manager which apparantly has no idea about pages being used by BDB, and is allocating structures on top of BDB objects.
    Any ideas? Advice where to investigate?
    thanks,
    SF

    Steve,
    First, the Xerces-C DOM implementation in BDB XML is not entirely complete, and is mostly read-only from an application perspective. So if you are doing anything to modify the returned DOM you run some risk. It's implemented using Xerces-C 2.7.
    Second, the availability of the Xerces-C DOM in BDB XML has a limited lifetime. It will almost certainly not be availble in the next release of BDB XML, so it's not something you should rely on. You may be best off serializing your results and if you want to manipulate them using Xerces, re-parse it into a DOM implementation that you control. I realize there is loss of efficiency in doing this.
    In our next release there are changes being made (for very good reasons) that make it impossible to maintain the XmlDocument::getContentAsDOM() interface. If we did keep it, we'd just be serializing and re-parsing anyway.
    Regards,
    George

Maybe you are looking for

  • Lenovo G50-30 Unable to access BIOS settings after Windows recovery

    Hi I recently 'downgraded' a recently purchased Lenovo G50-30 with preinstalled Windows 8.1 to Windows 7 using a UEFI USB install on a GPT partition. I also updated the BIOS from A7CN40WW to the latest A7CN43WW and all was working fine. However, afte

  • Flash Player crashes on every browser?

    I know this topic seems to be common, but a lot of the things I have seen in other posts really has not helped me at all. So, I think it's my turn to ask. I am on Flash 11.2.202.235. My OS is Mac OS X Lion. No matter what browser I use, or at least t

  • Importing Sony PMW EX1 footage into FCPX

    I just got a Sony PMW-EX1 (not the 1r).  I'm not very familiar with this format and I'm having trouble getting my footage into FCPX.  I imported a clip the way I thought it should be done and it simply showed up as a green clip.  Would someone famili

  • How to programatically convert XDP form into Dynamic PDF form

    Hi, Is there a way to programatically convert XDP form into Dynamic PDF form using LiveCycle Service APIs? Thanks, lcfun

  • Native threads on solaris 2.6

    Hi everyone, I was wondering if anyone had any problems using WLS 4.5.1 with weblogic's oracle pool driver with a JDK1.2.2 vm running with native threads. We had been running with green threads and we want to consider using native threads for perform