Using XML parser objects

This question was posted in response to the following article: http://help.adobe.com/en_US/Director/11.5/UsingScripting/WScf09ce35f85d76b4-31c73ea211d558 551a5-7ffb.html

where is the samples XML parser & JScript ?

Similar Messages

  • Using XML-based object structures to represent data in code/at run-time

    Hello,
    I have quite a "high level" question which has be bothering me for some time, and I haven't found the subject tackled in any books. I believe J2SE/J2EE is not an important divide here.
    Lets say I want to develop a J2SE game application with two programs: a "level designer", and a "level viewer", and I want to store the level files in an XML format.
    My question, and I use this example only to try and illustrate it, is:
    when coding the level designer or viewer, is it reasonable to use an XML-based object hierarchy for representing a level in code/at run-time, i.e. using the standard Java DOM APIs? Or should one (as I would have done before XML came along) develop a set of classes much closer to modelling the real form of a level, and then add a means to convert those objects to/from to XML format?
    This second option of course I would use/would have used if I wasn't thinking about XML, but isn't it sometimes easier to just read in an XML file into a DOM representation and just use the data straight out of that structure, rather than go through the bother of parsing the XML into a set of unrelated objects defined by a different family of classes? What shapes your decision here? And if the second option is best, what is the easiest way of converting to/from the XML?
    Thank you for any advice.
    Greg

    Hi Christian,
    Can I ask: what about if your domain was quite 'close' to an object/DOM representation of XML?
    For instance, what if a game operated by acting out a theatrical script, a spoken conversation, between two characters, perhaps somehow influenced at points by the user, and a particular level was just a different script for the characters.
    One could imagine that the object representation of this would in the end be quite similar to how you'd represent XML, i.e. like a tree of nodes, where each node was a line from the script, and some nodes were a decision point where different nodes could be chosen from.
    Would you still want to avoid using XML-based classes to represent the underlying 'game', or is there a point where you would 'give it' to the similarity and use existing XML structures directly?
    Thank you for any advice
    Greg

  • Using XML Parser for PL/SQL in 8.1.7

    The XML Parser for PL/SQL is part of 8.1.7,
    which is a good thing.
    Now my question: What steps do I need to
    perfom after installation of 8.1.7 to make
    the parser available for my PL/SQL packages,
    which call
    xmldom.makeNode()
    xmldom.appendChild()
    xmlparser.newParser()
    and other procedures from these packages ?
    The schema SYS does not contain the
    required packages XMLDOM, XMLPARSER, ...
    after installation of 8.1.7.
    Do I have to call loadjava and
    sqlplus @load.sql extra as in 8.1.5 and
    8.1.6 before ?
    Of course I'd like to use the natively
    compiled XML parser
    libjox8_oraclexml_parser_v2.so.
    Doesn't the above loadjava override the
    installation of this fast parser ?
    How can I be safe, that I am using the fast
    parser under the PL/SQL cover ?
    Tnx for your help
    Richard
    null

    Richard,
    That's weird? The packages were installed when I installed 8.1.7. You can just download the latest version of the XDK and reinstall using loadjava and then running the load.sql file to get the packages in. You should use the -f parameter for loadjava to force the new classes to be loaded over the old ones. For code examples and lots of other good tips on using the XDK, check out my new website for everything Oracle and XML at: www.webspedite.com/oracle.

  • How use XML-Parser in Web Dypro (how get filename)

    Hi everybody,
    i want to use the saxparser to read a xml-file via a Fileupload-UI element. In Web Dynpro it is not possible to get the path of a file which was on a client through the Fileupload-UI. So how can i use a xml-parser when i have to give it the file name?
    Is it possible to use the "resource" of the Fileupload-UI instead ot the filename? How can i call the parser?
                        SAXParser saxParser= null;
         try{                   
              SAXParserFactory factory = SAXParserFactory.newInstance();               
              saxParser = factory.newSAXParser();               
              saxParser.parse( new File(??????), new  Gaeb());
         }catch (Exception ex){
              ex.printStackTrace();
    regards,
    Sid

    Hi Siarhei,
    i bind the resource property to my context of type IWDResource, the xml-file is now uploaded to KM-Content : /documents/GSW/Upload_UT_Sample_A.xml.
    I create with resource.getURL() the path of the xml-file and give it to my xml-parser class, but i cannot get any value
    from my parser (value returns "null"). Now i don't know if i have a mistake in creating the path of my file or a mistake in my parser??
    Could you please have a look to my  source code:
    I try to get the path with:
           /* Get Path of "/documents/GSW/XML/Upload_UT_Sample_A.xml" */
           String urlToFile = resource.getUrl(WDFileDownloadBehaviour.AUTO.ordinal());                  
          /* Call the Parser Class with path*/
          MyXMLParser myParser= new MyXMLParser ( urlToFile );
          /* Get one value from xml-class*/
          wdComponentAPI.getMessageManager().reportSuccess("Value: " + myParser.getValue());  <-- returns "null"     
    My XML-Class:
    public class MyXMLParser extends DefaultHandler {
         private String path = null;
         private String fName = null;
         public  String lValue;     
         private boolean lSupplier = false;
         private boolean lQuoteNumber = false;     
         public Gaeb(){ }
         public Gaeb(String path){
              SAXParserFactory factory = null;                         
              SAXParser saxParser = null;
              try {
                   factory = SAXParserFactory.newInstance();                         
                   saxParser = factory.newSAXParser();               
                   saxParser.parse( path , new MyXMLParser () );     <-- i try also new File(path) instead of path.          
              }     catch (Exception ex){               
                   ex.printStackTrace();
         public void startElement(String uri, String localName,
              String qName, Attributes attributes)
              throws SAXException {     
              lSupplier = true;        
         public void characters(char[] ch, int start, int length)
              throws SAXException {
              if (lSupplier){
                   this.lValue = new String (ch,start,length);
         public String getValue(){
              return this.lValue;
    regards,
    Sid
    Edited by: Sid on Dec 2, 2009 2:47 PM

  • Invalid InputSource Error using XML Parser V2

    I'm using the following code to read xml from
    a clob field in an Oracle database.
    try
    // Parse xsl and xml documents
    parser = new DOMParser();
    parser.setPreserveWhitespace(true);
    Statement sqlSel=conn.createStatement();
    ResultSet xmlDet=sqlSel.executeQuery("SELECT * FROM USER_XML WHERE IHC_USER_ID='123456789'");
    if (xmlDet.next())
    CLOB xmlCLOB= ((OracleResultSet)xmlDet).getCLOB(2);
    int index=0;
    Reader clobStream=xmlCLOB.getCharacterStream();
    parser.parse(clobStream);
    Everything seems to work fine, and I can
    create a String from the stream which contains the entire XML document. However, if I try to do the above and parse the Stream, or alternatively parse the String resulting from the stream, I get the following Error:
    nvalid InputSource.
    void oracle.xml.parser.v2.XMLError.flushErrors()
    void oracle.xml.parser.v2.XMLError.error(int, int, java.lang.String, java.lang.String, java.lang.String, int, java.lang.Exception, int, boolean)
    void oracle.xml.parser.v2.XMLError.error(oracle.xml.parser.v2.XMLReader, java.lang.String, int, java.lang.Exception, int, boolean)
    void oracle.xml.parser.v2.XMLReader.pushXMLReader(org.xml.sax.InputSource)
    void oracle.xml.parser.v2.XMLParser.parse(java.lang.String)
    void xmlquerydb.testParse()
    void xmlquerydb.main(java.lang.String[])
    Any ideas what could cause this?

    I'm quite sure the xml documents are valid.
    At present, I'm just using booklist.xml,
    which comes as an example with the XML SQL
    utility. The problem is not really with the
    parsing (If I convert the xml into a url then it parses fine).
    My real problem is pulling the document out
    of a CLOB field. Regardless of what I pass to the parser( a string or a stream), or which xml its parsing, I still get the Invalid inputsource error.

  • Nokia E61i Push Data using XML Cisco Objects?

    Hi:
    I have a Nokia E61 (wifi) suscribed to a Cisco Call Manager.
    Is there any posibility to Push Data to the device?, like XML Cisco Objects to IP Phone 7970.
    Could I send an SMS without use the mobile network?
    thanks in advance,
    marcelo

    Thanks for the reply. Yes, I did compile all the Java and it
    works OK with a simple Java program. It just will not work in a
    Flex application.
    The java classes are:
    RRA:
    package blah.myPackage;
    import java.util.List;
    import java.util.Collection;
    import flex.data.DataSyncException;
    import flex.data.assemblers.AbstractAssembler;
    class RRA extends AbstractAssembler
    public Collection fill( List fillParameters )
    RRS service = new RRS();
    return service.getSome();
    RRS:
    package blah.myPackage;
    import java.util.ArrayList;
    import java.util.List;
    import java.sql.*;
    import flex.EORS.*;
    class RRS
    public List getSome()
    ArrayList list = new ArrayList();
    String str = "bob";
    RR rr = new RR(str);
    list.add(rr);
    return list;
    RR:
    package blah.myPackage;
    class RR
    private String name;
    public RR() { }
    public RR(String name)
    this.name = name;
    public String getName()
    return this.name;
    public void setName(String name)
    this.name = name;
    I started with something that retrieved data from a database
    but watered it down just to try and get some kind of communication
    between Flex and Java.

  • Using XML parser in Java

    Hi,
    I would like to distribute the Java XML parser with my product (which does not include an Oracle database).
    Do you have an idea, if this can be done ?
    The license agreement is "for a single developer". My local reseller has no clue if I can use for free, or how much does it cost.
    Any idea ?

    Free runtime redistribution. visit the latest download page for the production version to see the verbage.

  • Xml regex help - can't use xml parser

    Hi,
    I receive xmls from a legacy system and use JAXB to parse these xml's into java objects.
    The xml looks roughly like this:
    <root-Tag>
       <general-Info-Tag-1>blah</<general-Info-Tag-1>
       <general-Info-Tag-2>blah</<general-Info-Tag-2>
       <general-Info-Tag-3>blah</<general-Info-Tag-3>
       <entry-Tag>
          <entry-info-Tag-1>info</entry-info-Tag-1>
          <entry-info-Tag-2>info</entry-info-Tag-2>
           etc...
       </entry-Tag>
       <entry-Tag>
          <entry-info-Tag-1>info</entry-info-Tag-1>
          <entry-info-Tag-2>info</entry-info-Tag-2>
           etc...
       </entry-Tag>
    </root-Tag>The xml contains a root tag.
    The root element contains some general info tags and entry tags.
    The entry elements contain some entry relevant info inside nested tags.
    It's important to note that this the xml is not nested anymore than the entry-info tags.
    My Problem:
    The info in the entry-info-tags sometimes contains illegal chars like <,>,& and is not wrapped
    properly by a CDATA section.
    So I need to find these elements and wrap them with <![CDATA[info]]> before using JAXB.
    How can I achieve this using Pattern/Matcher? I've been unsuccessful so far...
    Edited by: Samuelz on Jul 1, 2010 1:58 AM

    Heres what i've got so far:
    A helpful function to print out matches for regex on an input string:
    private static void printMathces(final String regex, final String input) {
         Pattern p = Pattern.compile(regex, Pattern.DOTALL);
         Matcher m = p.matcher(input);
         while (m.find()){
              System.out.println("found:");
              for (int i = 0; i < m.groupCount(); i++)
                   System.out.println(i + ":" + m.group(i));
    }My input string for testing:
    String s =
    "<entries>\n"+
         "<entry>\n" +
              "<TagName>sam&max</TagName>\n" +
         "</entry>\n" +
         "<entry>\n" +
              "<TagName><![CDATA[sam&max]]></TagName>\n" +
         "</entry>\n" +
    "</entries>\n";regex to get contents of TagName:
    printMatches("<(TagName)>((.*?))</\\1>+", s);
    found:
    0:<TagName>sam&max</TagName>
    1:TagName
    2:sam&max
    found:
    0:<TagName><![CDATA[sam&max]]></TagName>
    1:TagName
    2:<![CDATA[sam&max]]>regex to get content of TagName when its wrapped by CDATA
    printMathces("<(TagName)><!\\[CDATA\\[((.*?))\\]\\]></\\1>", s);
    found:
    0:<TagName><![CDATA[sam&max]]></TagName>
    1:TagName
    2:sam&maxI'm trying to build a regex that will find the contents of TagName without knowing if its already wrapped by CDATA and then replace these matches by something like <$1><![CDATA[$2]]</$1>
    How do I "combine" these 2 regular expressions?

  • Problem Using XML Parser

    Hi,
    I've tried to criete an IFS user using a createUser.xml but executing the command line ifsput i receive the following error:
    Error: PUT: IFS-12649:ClassSelectionParser: Cannot envoke without the Parse.CURRENT_PATH_OPTION and Parse.CURRENT_NAME_OPTION
    Even if I think about a configuration problem I don't know what to do. Can anyone help me?
    THANKS

    Does the createUser.xml file work when imported via SMB (MS Explorer)?
    Please include the content of the createUser.xml file.
    Also, it appears that you have created a mapping between the .xml extension and the ClassSelectionParser. This would circumvent the XimpleXMLParser which is responsible for creating the user from an xml configuration file.

  • Problem for using oracle xml parser v2 for 8.1.7

    My first posting was messed up. This is re-posting the same question.
    Problem for using oracle xml parser v2 for 8.1.7
    I have a sylesheet with
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">.
    It works fine if I refer this xsl file in xml file as follows:
    <?xml-stylesheet type="text/xsl" href="http://...../GN.xsl"?>.
    When I use this xsl in pl/sql package, I got
    ORA-20100: Error occurred while processing: XSL-1009: Attribute 'xsl:version' not found in 'xsl:stylesheet'.
    After I changed name space definition to
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> in xsl file, I got
    ORA-20100: Error occurred while processing: XSL-1019: Expected ']' instead of '$'.
    I am using xml parser v2 for 8.1.7
    Can anyone explain why it happens? What is the solution?
    Yi

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Element's dont have text content, they [b]contain text node children.
    So instead of trying to setNodeValue() on the element, construct a Text node and use the appendChild method on the element to append the text node as a child of the element.<HR></BLOCKQUOTE>
    Steve,
    We are also creating an XML DOM from java and are having trouble getting the tags created as we want. When we use XMLText it creates the tag as <tagName/>value rather than <tagName>value</tagName>. We want separate open and close tags. Any ideas?
    Lori

  • Use of XML parser to read/parse xml stored in DB as CLOB

    Hello,
    I am new to XML technology. I have xml data stored in DB as
    CLOB. I need to parse this data to retrieve VALUE fro certain
    tags. I would greatly appreciate any help. Any examples that
    manipulate xml data stored in DB can be of extreme help.
    DesiDBA

    As you use Oracle 9.0.1. We suggest you use XMLType instead of
    CLOB to store your XML documents.
    You can use xmlType.extract() to get the elements within the
    XMLDocuments.
    Please refer to our Oracle9i XML Demo for examples.
    http://otn.oracle.com/tech/xml/xdk_sample/xdkdemo_faq.html
    For Instructions:
    http://ws5.olab.oracle.com/faqdemo/source/instruction.xsql?
    pagename=ins_xmltype
    Or you have to do the SQL query to get XML documents and parse
    each document and extract the content yourself using XML Parser
    for PL/SQL.
    Thanks.

  • XML Parser for PL/SQL and related issues

    I need to have further information about some of the following
    issues and XML features and make a determination useful for
    evaluation and recommendation:
    ISSUES
    1) Is there a maximum size for an XML document to provide data
    for PL/SQL(or SQL) across tables, provided that no CLOB are used?
    2) How about from Oracle to an XML document ?
    3) Is there a ratio between XML document size and main memory and
    SGA size. What are Oracle's recommendations /
    4) Can the Oracle Application Server run on a DHCP NT server when
    using XML parsing ? Is it NT Service Pack 3 and 4 compatible ?
    5) How parsers can interact with one another or related tools ?
    For example, how the XML parser for c/c++ could be useful when
    using Pro*C/C++ (programmer 2000) or OCI interfaces ? In other
    words, what is the business logic in using these tools ?
    null

    Anthony D. Noriega (guest) wrote:
    : I need to have further information about some of the following
    : issues and XML features and make a determination useful for
    : evaluation and recommendation:
    : ISSUES
    : 1) Is there a maximum size for an XML document to provide data
    : for PL/SQL(or SQL) across tables, provided that no CLOB are
    used?
    The limit should be what can be inserted into an object view.
    : 2) How about from Oracle to an XML document ?
    The limit should be what can be retrieved from an object view.
    : 3) Is there a ratio between XML document size and main memory
    :and SGA size. What are Oracle's recommendations /
    Not directly due to the relationship between XML metadata and
    data not being constrained.
    : 4) Can the Oracle Application Server run on a DHCP NT server
    : when using XML parsing ?
    If it can run a JavaVM with the correct permissions there are no
    other special requirements.
    :Is it NT Service Pack 3 and 4 compatible ?
    No special requirements here.
    : 5) How parsers can interact with one another or related tools ?
    : For example, how the XML parser for c/c++ could be useful when
    : using Pro*C/C++ (programmer 2000) or OCI interfaces ? In
    other
    : words, what is the business logic in using these tools ?
    Not really sure of your question. The XML components are useful
    in any application where I am processing documents or data with
    an XML structure. The choice to use XML can be based on quite a
    range of requirements due to its declarative syntax and open
    standards. If you give me a specific application, I can perhaps
    be more helpful.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

  • Xml parser v2.0.2.9

    We are in the beginning stages of our Oracle XML Gateway project and have made no customizations to out-of-the-box expected functionality of XML gateway product. Currently using Oracle 11.5.7 and RDBMS 8.1.7.3.0
    when running ecxver.sql, results indicated that there were invalid XML parser objects and that it needed to be reinstalled using patch 2199206.
    We downloaded the patch but our SysAdmin needs specific instructions on how to go about applying the patch (evidently it is just file replacement and she needs specific instructions) Our SysAdmin can't find any documentation about the XML parser v2.0.2.9 and installation of that patch.
    Am I correct in assuming that we actually need to run a sql script to LOAD the parser from the XDK library? If so, could someone please point us in the right direction?
    Your help is greatly appreciated!
    Meg Hanson

    Please send the TAR name to me.

  • Database retrival using xml

    how can I retrieve data from database using xml?
    or else how can i connect to the database thru XML?

    Thanks for the reply !
    Suppose I have my data in SQL database.... So can I retrive that in xml?Well yes with caveats. OK:
    1.) Some very advanced databases allow you to retrieve XML directly from a database row, e.g. They send you an XML representation of the data.
    2.) A far more common way is to extract the data using any standard data access layer into Javabeans or POJO and then use a XML parser or a XSL stylesheet to convert the raw data into the XML format that you want.
    Or else another case is.....
    I'm storing my data in xml files... and after that if i need that same data in java programming , can I
    utilise that xml file??Yes, you can also in theory store the whole XML string and/or file in hte database (not normally recommended if you want a good relational database structure). Again you can then use XML parsing APIs to get data out of that XML stream and convert it to Java objects.
    Karianna
    PS: It sounds like you're attempting this for the first time, good on you! But I sugeest strongly that you take a tutorial or get sometihng like the OReillly Java and XML book. This is a very large topic......
    >

  • XML Parser related.

    Hi!
    Has anybody tried building the IBM's XML4c3_5_1
    XML C++ parser source on Solaris7/8 using Forte6 Update 1 compiler ?
    If yes, can you let me know the issues involved.
    thanks in advance.
    -sri

    Anthony D. Noriega (guest) wrote:
    : I need to have further information about some of the following
    : issues and XML features and make a determination useful for
    : evaluation and recommendation:
    : ISSUES
    : 1) Is there a maximum size for an XML document to provide data
    : for PL/SQL(or SQL) across tables, provided that no CLOB are
    used?
    The limit should be what can be inserted into an object view.
    : 2) How about from Oracle to an XML document ?
    The limit should be what can be retrieved from an object view.
    : 3) Is there a ratio between XML document size and main memory
    :and SGA size. What are Oracle's recommendations /
    Not directly due to the relationship between XML metadata and
    data not being constrained.
    : 4) Can the Oracle Application Server run on a DHCP NT server
    : when using XML parsing ?
    If it can run a JavaVM with the correct permissions there are no
    other special requirements.
    :Is it NT Service Pack 3 and 4 compatible ?
    No special requirements here.
    : 5) How parsers can interact with one another or related tools ?
    : For example, how the XML parser for c/c++ could be useful when
    : using Pro*C/C++ (programmer 2000) or OCI interfaces ? In
    other
    : words, what is the business logic in using these tools ?
    Not really sure of your question. The XML components are useful
    in any application where I am processing documents or data with
    an XML structure. The choice to use XML can be based on quite a
    range of requirements due to its declarative syntax and open
    standards. If you give me a specific application, I can perhaps
    be more helpful.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

Maybe you are looking for

  • Want to update data in a view based on multiple tables

    Hi I am facing a problem i want to update data in tables using a view. As that view is based on multiple tables so i am unable to update data. i came to know we can update table from view only if view is based on single table. so if anyone knows any

  • Is something wrong with this site today?

    I posted a question (in the Time Capsule section) last night.  This morning, I got an email copy of a reply that was complete and readable.  If I click "read entire discussion, I see the whole thread (original post & answer).  But if I sign in to the

  • KILL SESSION Procedure

    i have created a procedure that I will check for open sessions and then kill them. I tried to compile this procedure using sqldeveloper and the output i got was Warning: execution completed with warning. package body Compiled. I then go and look for

  • Printable Versions of NIWeek Schedules

    I was having a lot of trouble printing the NIWeek schedules on 8.5" X 11" paper, so finally I resorted to altering them. Took a heckuva lotta time, so I thought someone else might get some use out of it. The first is the PDF file at this URL, whose n

  • Playing old games on OSX

    Does anyone know if there is something I can get to play old Mac games. I really want to play my MDK again. I have a macbook Pro.