Parsing XML with incomplete tags

Message was edited by:
user490857

Hello,
How about the following?
Change your XML document to:
<?xml version='1.0' encoding='utf-8'?>
<response>
     <title> this is book on &amp;lt;tags&amp;gt; Order </title>
</response>
Running the following code:
String xmlstring = "<?xml version='1.0' encoding='utf-8'?><response><title> this is book on &amp;lt;tags&amp;gt; Order </title></response>";
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder db = factory.newDocumentBuilder();
InputSource inStream = new InputSource();
inStream.setCharacterStream(new StringReader(xmlstring));
Document doc1 = db.parse(inStream);              
System.out.println(doc1.getDocumentElement().getFirstChild().getFirstChild().getNodeValue());
Will produce the following result:
this is book on <tags> Order
-Blaise
Message was edited by:
Blaise Doughan

Similar Messages

  • Parsing XML with html tags for style

    I'm using flash to pull in XML data, but I want to use html
    tags to be able to style the text. When I add any html, it treats
    it as a sub-node and ignores the data. Also, line breaks in the xml
    are being converted to double spaced paragraphs? The relevant code
    is basically this:
    if (element.nodeName.toUpperCase() == "TEXT")
    {//add text to text array
    ar_text[s]=element.firstChild.nodeValue;
    textbox1.text = ar_text[0];

    try to use htmlText instead text... like this:
    textbox1.htmlText = ar_text[0]
    adam

  • Problem parsing XML with schema when extracted from a jar file

    I am having a problem parsing XML with a schema, both of which are extracted from a jar file. I am using using ZipFile to get InputStream objects for the appropriate ZipEntry objects in the jar file. My XML is encrypted so I decrypt it to a temporary file. I am then attempting to parse the temporary file with the schema using DocumentBuilder.parse.
    I get the following exception:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element '<root element name>'
    This was all working OK before I jarred everything (i.e. when I was using standalone files, rather than InputStreams retrieved from a jar).
    I have output the retrieved XML to a file and compared it with my original source and they are identical.
    I am baffled because the nature of the exception suggests that the schema has been read and parsed correctly but the XML file is not parsing against the schema.
    Any suggestions?
    The code is as follows:
      public void open(File input) throws IOException, CSLXMLException {
        InputStream schema = ZipFileHandler.getResourceAsStream("<jar file name>", "<schema resource name>");
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = null;
        try {
          factory.setNamespaceAware(true);
          factory.setValidating(true);
          factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
          factory.setAttribute(JAXP_SCHEMA_SOURCE, schema);
          builder = factory.newDocumentBuilder();
          builder.setErrorHandler(new CSLXMLParseHandler());
        } catch (Exception builderException) {
          throw new CSLXMLException("Error setting up SAX: " + builderException.toString());
        Document document = null;
        try {
          document = builder.parse(input);
        } catch (SAXException parseException) {
          throw new CSLXMLException(parseException.toString());
        }

    I was originally using getSystemResource, which worked fine until I jarred the application. The problem appears to be that resources returned from a jar file cannot be used in the same way as resources returned directly from the file system. You have to use the ZipFile class (or its JarFile subclass) to locate the ZipEntry in the jar file and then use ZipFile.getInputStream(ZipEntry) to convert this to an InputStream. I have seen example code where an InputStream is used for the JAXP_SCHEMA_SOURCE attribute but, for some reason, this did not work with the InputStream returned by ZipFile.getInputStream. Like you, I have also seen examples that use a URL but they appear to be URL's that point to a file not URL's that point to an entry in a jar file.
    Maybe there is another way around this but writing to a file works and I set use File.deleteOnExit() to ensure things are tidied afterwards.

  • Parsing XML with invalid URI for DTD

    When parsing an XML file (with aelfred2) I get the following error:
    Exception in thread "main" gnu.xml.dom.ls.DomLSException: Absolute URL required with null context: CQCGWProtocol.DTD
    at gnu.xml.dom.ls.DomLSParser.doParse(libgcj.so.7)
    at gnu.xml.dom.ls.DomLSParser.parse(libgcj.so.7)
    at gnu.xml.dom.DomDocumentBuilder.parse(libgcj.so.7)
    at CQC.main(CQC.java:44)
    Caused by: java.net.MalformedURLException: Absolute URL required with null context: CQCGWProtocol.DTD
    at java.net.URL.<init>(libgcj.so.7)
    at java.net.URL.<init>(libgcj.so.7)
    at gnu.xml.aelfred2.XmlParser.pushURL(libgcj.so.7)
    at gnu.xml.aelfred2.XmlParser.parseDoctypedecl(libgcj.so.7)
    at gnu.xml.aelfred2.XmlParser.parseProlog(libgcj.so.7)
    at gnu.xml.aelfred2.XmlParser.parseDocument(libgcj.so.7)
    I'm puzzled, as I have disabled validation:
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    domFactory.setIgnoringComments(true);
    domFactory.setNamespaceAware(false);
    domFactory.setValidating(false);
    My goal is to have the parser ignore the DOCTYPE tag and not try to find the DTD. Can someone suggest how you turn this off - apparently, setting the validation to false is not the right approach.
    I'm running Java 1.4.2 on Fidora Core 5.
    Thanks for suggestions!

    Create an org.xml.sax.EntityResolver and apply it to your parser. The API documentation for the interface has an example of how to write one.
    And no, turning of validation doesn't turn off processing of DTDs because DTDs are for things other than validation. Entity replacement, for example.

  • Parsing XML with .ReadXml

    Hi,
    I have an xml file which I'm parsing with following code
    //check if the xml is properly parsed
    XmlDocument xmlDoc = new XmlDocument();
    xmlDoc.LoadXml(strXML);
    //load the data set from the valid xml string
    System.IO.StringReader sr = new System.IO.StringReader(strXML);
    ds.ReadXml(sr);
    The xml has following tags:
    <trlFlags>
    <trlUpdDepCust />
    <trlCatCust />
    <trlFuelOnly />
    <trlFuelSale />
    </trlFlags>
    When I look the content of table trlFlags I see columns trlUpdDepCust, trlCatCust, trlFuelOnly, etc. All rows in the table have blank value in these columns.
    This is not that I want. I want that a row in trlFlags table had a value, say, 1 in trlUpdDepCust column if <trlUpdDepCust /> tag is present.
    Is it doable?
    Thanks.
    Remember to mark as an answer if this post has helped you.

    Magnus, thank you for your help.
    Let me clarify the issue using the example below.
    Node 1. 
            <trlFlags>
    <trlFstmp />
            </trlFlags>
    Node 2:
    <trlFlags>
    <trlPLU />
    </trlFlags>
    Here is the desired output:
    Remember to mark as an answer if this post has helped you.
    Hi lgor,
    From your xml file, this is not good xml format.
    Here give you a sample about dataset.ReadXml() from MSDN.
    <XmlDS>
    <table1>
    <col1>Value1</col1>
    </table1>
    <table1>
    <col1>Value2</col1>
    </table1>
    </XmlDS>
    DataSet dataSet = new DataSet();
    DataTable dataTable = new DataTable("table1");
    dataTable.Columns.Add("col1", typeof(string));
    dataSet.Tables.Add(dataTable);
    string xmlData = "<XmlDS><table1><col1>Value1</col1></table1><table1><col1>Value2</col1></table1></XmlDS>";
    System.IO.StringReader xmlSR = new System.IO.StringReader(xmlData);
    dataSet.ReadXml(xmlSR);
    Reslut
    The ReadXml method provides a way to read either data only, or both data and schema into a
    DataSet from an XML document.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Persisting unexplained errors when parsing XML with schema validation

    Hi,
    I am trying to parse an XML file including XML schema validation. When I validate my .xml and .xsd in NetBeans 5.5 beta, I get not error. When I parse my XML in Java, I systematically get the following errors no matter what I try:
    i) Document root element "SQL_STATEMENT_LIST", must match DOCTYPE root "null".
    ii) Document is invalid: no grammar found.
    The code I use is the following:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    My XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Defining the SQL_STATEMENT_LIST element -->
    <xs:element name="SQL_STATEMENT_LIST" type= "SQL_STATEMENT_ITEM"/>
    <xs:complexType name="SQL_STATEMENT_ITEM">
    <xs:sequence>
    <xs:element name="SQL_SCRIPT" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <!-- Defining simple type ApplicationType with 3 possible values -->
    <xs:simpleType name="ApplicationType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="DawningStreams"/>
    <xs:enumeration value="BaseResilience"/>
    <xs:enumeration value="BackBone"/>
    </xs:restriction>
    </xs:simpleType>
    <!-- Defining the SQL_SCRIPT element -->
    <xs:element name="SQL_SCRIPT" type= "SQL_STATEMENT"/>
    <xs:complexType name="SQL_STATEMENT">
    <xs:sequence>
    <xs:element name="NAME" type="xs:string"/>
    <xs:element name="TYPE" type="xs:string"/>
    <xs:element name="APPLICATION" type="ApplicationType"/>
    <xs:element name="SCRIPT" type="xs:string"/>
    <!-- Making sure the following element can occurs any number of times -->
    <xs:element name="FOLLOWS" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and my XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Document : SQLStatements.xml
    Created on : 1 juillet 2006, 15:08
    Author : J�r�me Verstrynge
    Description:
    Purpose of the document follows.
    -->
    <SQL_STATEMENT_LIST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.dawningstreams.com/XML-Schemas/SQLStatements.xsd">
    <SQL_SCRIPT>
    <NAME>CREATE_PEERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE PEERS (
    PEER_ID           VARCHAR(20) NOT NULL,
    PEER_KNOWN_AS      VARCHAR(30) DEFAULT ' ' ,
    PRIMARY KEY ( PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITIES_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITIES (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    COMMUNITY_KNOWN_AS VARCHAR(25) DEFAULT ' ',
    PRIMARY KEY ( COMMUNITY_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITY_MEMBERS (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    PEER_ID VARCHAR(20) NOT NULL,
    PRIMARY KEY ( COMMUNITY_ID, PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_PEER_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE PEERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITIES_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITIES IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITY_MEMBERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_VIEW</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE VIEW COMMUNITY_MEMBERS_VW AS
    SELECT P.PEER_ID, P.PEER_KNOWN_AS, C.COMMUNITY_ID, C.COMMUNITY_KNOWN_AS
    FROM PEERS P, COMMUNITIES C, COMMUNITY_MEMBERS CM
    WHERE P.PEER_ID = CM.PEER_ID
    AND C.COMMUNITY_ID = CM.COMMUNITY_ID
    </SCRIPT>
    <FOLLOWS>CREATE_PEERS_TABLE</FOLLOWS>
    <FOLLOWS>CREATE_COMMUNITIES_TABLE</FOLLOWS>
    </SQL_SCRIPT>
    </SQL_STATEMENT_LIST>
    Any ideas? Thanks !!!
    J�r�me Verstrynge

    Hi,
    I found the solution in the following post:
    Validate xml with DOM - no grammar found
    Sep 17, 2003 10:58 AM
    The solution is to add a line of code when parsing:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    The errors are gone !!!
    J�r�me Verstrynge

  • How to Parse XML with SAX and Retrieving the Information?

    Hiya!
    I have written this code in one of my classes:
    /**Parse XML File**/
              SAXParserFactory factory = SAXParserFactory.newInstance();
              GameContentHandler gameCH = new GameContentHandler();
              try
                   SAXParser saxParser = factory.newSAXParser();
                   saxParser.parse(recentFiles[0], gameCH);
              catch(javax.xml.parsers.ParserConfigurationException e)
                   e.printStackTrace();
              catch(java.io.IOException e)
                   e.printStackTrace();
              catch(org.xml.sax.SAXException e)
                   e.printStackTrace();
              /**Parse XML File**/
              games = gameCH.getGames();And here is the content handler:
    import java.util.ArrayList;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    class GameContentHandler extends DefaultHandler
         private ArrayList<Game> games = new ArrayList<Game>();
         public void startDocument()
              System.out.println("Start document.");
         public void endDocument()
              System.out.println("End document.");
         public void startElement(String namespaceURI, String localName, String qualifiedName, Attributes atts) throws SAXException
         public void endElement(String namespaceURI, String localName, String qualifiedName) throws SAXException
         public void characters(char[] ch, int start, int length) throws SAXException
              /**for (int i = start; i < start+length; i++)
                   System.out.print(ch);
         public ArrayList<Game> getGames()
              return games;
    }And here is the xml i am trying to parse:<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
    <Database>
         <Name></Name>
         <Description></Description>
         <CurrentGameID></CurrentGameID>
         <Game>
              <gameID></gameID>
              <name></name>
              <publisher></publisher>
              <platform></platform>
              <type></type>
              <subtype></subtype>
              <genre></genre>
              <serial></serial>
              <prodReg></prodReg>
              <expantionFor></expantionFor>
              <relYear></relYear>
              <expantion></expantion>
              <picPath></picPath>
              <notes></notes>
              <discType></discType>
              <owner></owner>
              <location></location>
              <borrower></borrower>
              <numDiscs></numDiscs>
              <discSize></discSize>
              <locFrom></locFrom>
              <locTo></locTo>
              <onLoan></onLoan>
              <borrowed></borrowed>
              <manual></manual>
              <update></update>
              <mods></mods>
              <guide></guide>
              <walkthrough></walkthrough>
              <cheats></cheats>
              <savegame></savegame>
              <completed></completed>
         </Game>
    </Database>I have been trying for ages and just can't get the content handler class to extract a gameID and instantiate a Game to add to my ArrayList! How do I extract the information from my file?
    I have tried so many things in the startElement() method that I can't actually remember what I've tried and what I haven't! If you need to know, the Game class instantiates with asnew Game(int gameID)and the rest of the variables are public.
    Please help someone...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    OK, how's this?
    public void startElement(String namespaceURI, String localName, String qualifiedName, Attributes atts) throws SAXException
              current = "";
         public void endElement(String namespaceURI, String localName, String qualifiedName) throws SAXException
              try
                   if(qualifiedName.equals("Game") || qualifiedName.equals("Database"))
                        {return;}
                   else if(qualifiedName.equals("gameID"))
                        {games.add(new Game(Integer.parseInt(current)));}
                   else if(qualifiedName.equals("name"))
                        {games.get(games.size()-1).name = current;}
                   else if(qualifiedName.equals("publisher"))
                        {games.get(games.size()-1).publisher = current;}
                   etc...
                   else
                        {System.out.println("ERROR - Qualified Name found in xml that does not exist as databse field: " + qualifiedName);}
              catch (Exception e) {} //Ignore
         public void characters(char[] ch, int start, int length) throws SAXException
              current += new String(ch, start, length);
         }

  • XML Parsing issue with same tag names at multiple levels.

    My XML has the same tag name , ID at different levels in the XML.
    <InventorySearch>
    <*ID*>ID1</*ID*>
    <interactionDate>2012-09-01T10:30:00Z</interactionDate>
    <DescribedBy>
    <value>Cycle Count extract</value>
    <Characteristic>
    <*ID*>ID2</*ID*>
    </Characteristic>
    </DescribedBy>
    <type>Cycle Count</type>
    <InventorySearchComprisedOf>
    <*ID*>ID3</*ID*>
    <quantity>
    <amount>1</amount>
    <units>EACH</units>
    </quantity>
    <itemDateComplete>2012-09-07T10:30:00Z</itemDateComplete>
    <itemStatus>Open</itemStatus>
    </InventorySearchComprisedOf>
    </InventorySearch>
    When I use the Extract function with XML Sequence, I am getting all the ID values concatenated.
    select extract(value(d),'//ID/text()').getstringval() as id1,
    extract(value(e),'//ID/text()'). getstringval() as id2
    from xxnbn_cc_response_xml_stg x,
    table(xmlsequence(extract(x.xml_column,'/InventorySearch'))) d,
    table(XMLSEQUENCE(extract(D.column_value,'//InventorySearchComprisedOf')))(+) E;
    Return values :
    ID1 - ID1ID2ID3
    ID2 - ID3
    Is this the right way to parse this type of XML?

    The answer would depend upon your version of Oracle
    select * from v$version
    and the desired result set you want to see.
    If you are 10.2 or later, than XMLTable would be easier to write, but I won't go that way until we know more about what you want to see.

  • Parsing errors with CDATA tags using oracle xml parser v2

    I'm using the oracle.xml.parser.v2 parser to combine a
    generated xml document from a database with a static
    xsl file to produce html. Within the xml document, there
    are fairly large CDATA sections (500 lines) which happen
    to contain javaScript.
    Occasionally, I'm getting xml tags in the final html
    document! It seems that the oracle parser pukes
    on a certain type of data within a CDATA tag, and then
    replaces an angle bracket (<) of a tag with a #60. This
    can cause html tags being viewed in the document. At
    first, I thought the amount of JavaScript within the
    CDATA tag was too large for the parser to handle,
    because when I split it up into 2 or more parts the errors
    went away. But, re-arranging the JavaScript (String in the CDATA tag)
    can make the errors disappear. And, if I
    use the Saxon parser to manually combine the xsl with
    the xml, the output is fine. If anyone knows that this is
    a confirmed bug by Oracle, or any other relevant info on
    this, please let me know.

    Hi,
    Your lucky, i've just finished a project that used the oracle parser extensively.
    I think the problem may stem from your xsl. Although your cdata tags may be well formed, in the xsl you might need to escape the text again, this may mean that the xsl needs to print a further cdata tag around the data. This is because the parser (well the version I was using) strips the cdata tags before the transformation happens.
    This is the probably the cause of the nasty html output.

  • Creating a PLSQL script to parse structured XML with repeated tags

    Hi, I'm trying to parse an xml feed but the way it's structured makes it difficult to pull out the values. (see example) Would anyone be able to recommend a solution or some ideas as to how to get around this?
    SAMPLE XML:<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
         <env:Header>
         </env:Header>
         <env:Body>
              <ns3:commandResponse xmlns:ns2="http://test.com/2011/Generic/schema" xmlns:ns3="http://test.com/2011/Generic">
                   <return>
                   <ns2:return>success</ns2:return>
                   <ns2:Command>issues</ns2:Command>
                        <ns2:WorkItems>
                             <ns2:Id>216141</ns2:Id>
                             <ns2:ModelType>Issue</ns2:ModelType>
                             <ns2:DisplayId>216141</ns2:DisplayId>
                             <ns2:Field>
                                  <ns2:Name>Type</ns2:Name>
                                  <ns2:Value>
                                       <ns2:Item>
                                            <ns2:Id>Dev Task</ns2:Id>
                                            <ns2:ModelType>Type</ns2:ModelType>
                                            <ns2:DisplayId>Dev Task</ns2:DisplayId>
                                       </ns2:Item>
                                  </ns2:Value>
                             </ns2:Field>
                             <ns2:Field>
                                  <ns2:Name>ID</ns2:Name>
                                  <ns2:Value>
                                       <ns2:int>216141</ns2:int>
                                  </ns2:Value>
                             </ns2:Field>
                             <ns2:Field>
                                  <ns2:Name>Reason</ns2:Name>
                                  <ns2:Value>
                                       <ns2:string>Integrating</ns2:string>
                                  </ns2:Value>
                             </ns2:Field>
                             <ns2:Field>
                                  <ns2:Name>Dev Task Component</ns2:Name>
                                  <ns2:Value>
                                       <ns2:string>Java Tools</ns2:string>
                                  </ns2:Value>
                             </ns2:Field>
                             <ns2:Field>
                                  <ns2:Name>Created Date</ns2:Name>
                                  <ns2:Value>
                                       <ns2:datetime>2009-08-10T15:52:39.000-04:00</ns2:datetime>
                                  </ns2:Value>
                             </ns2:Field>
                             <ns2:Field>
                                  <ns2:Name>Date Closed</ns2:Name>
                                  <ns2:Value/>
                             </ns2:Field>
                             <ns2:Field>
                                  <ns2:Name>Modified Date</ns2:Name>
                                  <ns2:Value>
                                       <ns2:datetime>2011-03-04T12:57:05.000-05:00</ns2:datetime>
                                  </ns2:Value>
                             </ns2:Field>
                        </ns2:WorkItems>
                   </return>
              </ns3:commandResponse>
         </env:Body>
    </env:Envelope>This is just a sample with just one WorkItem, but there would be much more, N number of items with 9 fields per item. (Not all of the fields were put in the sample, and some can have null values)
    I only need to pull the content from /ns2:WorkItems/ns2:Field/ns2:Value/ns2:Item/ns2:Id for the first field and the /ns2:value/* tag of all the other fields. Then put this in a table where each row is a workitem and the fields are the columns (create table workitems (Type,ID,Reason,Dev Task Component,Created Date, Date Closed, Modified Date) --all the fields should be varchar2 except the dates)
    What I've been trying so far seems rather brute force by running a nested loop to go through every item and field and then an IF case for each field 1,2,...9 which would insert the value into a table.
    At the moment I'm using something like below to pull a single value
    path1 = '//ns2:WorkItems[1]/ns2:Field[1]/ns2:Value[1]/ns2:Item[1]/ns2:Id[1]';
    nameserve = 'xmlns:ns2="http://test.com/2011/Generic/schema"';
    extractvalue(xmltype(src_clob),path1,nameserve);I'm not entirely sure if I would be able to substitute the [1]'s with [' || nitem || '] where nitem is loop number to do something like:
    for nitem in 1..itemcount
    loop
        FOR nfield in 1..9
        loop
            if nfield=1 then
                path1 := '//ns2:WorkItems[' || nitem || ']/ns2:Field[' || nfield || ']/ns2:Value[1]/ns2:Item[1]/ns2:Id';
                fieldvalue := extractvalue(xmltype(src_clob),path1,nameserve);';
            else
                path2 := '//ns2:WorkItems[' || nitem || ']/ns2:Field[' || nfield || ']/ns2:Value[1]/*[1]';
                fieldvalue := extractvalue(xmltype(src_clob),path2,nameserve);';
            end if;
        end loop;
    end loop;The problem with the above script is how do I insert this fieldvalue into different columns on a table without using an IF case for each field.
    I was wondering if there is simpler way to put each field into a different column and loop through every workitem. I looked into dynamically naming variables but I don't think plsql supports that.
    Any help/advice is appreciated,
    Thanks!
    Edited by: 843508 on Mar 10, 2011 1:56 PM
    Edited by: 843508 on Mar 10, 2011 1:57 PM
    Edited by: 843508 on Mar 10, 2011 2:01 PM

    If it were me, I wouldn't use PL/SQL to try and process XML, but would use SQL's XMLTABLE functionality e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  WITH t as (select XMLTYPE('
      2  <RECSET xmlns:aa="http://www.w3.org">
      3    <aa:REC>
      4      <aa:COUNTRY>1</aa:COUNTRY>
      5      <aa:POINT>1800</aa:POINT>
      6      <aa:USER_INFO>
      7        <aa:USER_ID>1</aa:USER_ID>
      8        <aa:TARGET>28</aa:TARGET>
      9        <aa:STATE>6</aa:STATE>
    10        <aa:TASK>12</aa:TASK>
    11      </aa:USER_INFO>
    12      <aa:USER_INFO>
    13        <aa:USER_ID>5</aa:USER_ID>
    14        <aa:TARGET>19</aa:TARGET>
    15        <aa:STATE>1</aa:STATE>
    16        <aa:TASK>90</aa:TASK>
    17      </aa:USER_INFO>
    18    </aa:REC>
    19    <aa:REC>
    20      <aa:COUNTRY>2</aa:COUNTRY>
    21      <aa:POINT>2400</aa:POINT>
    22      <aa:USER_INFO>
    23        <aa:USER_ID>3</aa:USER_ID>
    24        <aa:TARGET>14</aa:TARGET>
    25        <aa:STATE>7</aa:STATE>
    26        <aa:TASK>5</aa:TASK>
    27      </aa:USER_INFO>
    28    </aa:REC>
    29  </RECSET>') as xml from dual)
    30  -- END OF TEST DATA
    31  select x.country, x.point, y.user_id, y.target, y.state, y.task
    32  from t
    33      ,XMLTABLE(XMLNAMESPACES('http://www.w3.org' as "aa"),
    34                '/RECSET/aa:REC'
    35                PASSING t.xml
    36                COLUMNS country NUMBER PATH '/aa:REC/aa:COUNTRY'
    37                       ,point   NUMBER PATH '/aa:REC/aa:POINT'
    38                       ,user_info XMLTYPE PATH '/aa:REC/*'
    39               ) x
    40      ,XMLTABLE(XMLNAMESPACES('http://www.w3.org' as "aa"),
    41                '/aa:USER_INFO'
    42                PASSING x.user_info
    43                COLUMNS user_id NUMBER PATH '/aa:USER_INFO/aa:USER_ID'
    44                       ,target  NUMBER PATH '/aa:USER_INFO/aa:TARGET'
    45                       ,state   NUMBER PATH '/aa:USER_INFO/aa:STATE'
    46                       ,task    NUMBER PATH '/aa:USER_INFO/aa:TASK'
    47*              ) y
    SQL> /
       COUNTRY      POINT    USER_ID     TARGET      STATE       TASK
             1       1800          1         28          6         12
             1       1800          5         19          1         90
             2       2400          3         14          7          5p.s. XML questions are better suited in the XML DB forum:
    XML DB FAQ

  • Parsing XML with Namespace

    Hi,
    Can somebody help me with the following:-
    I have an XMLType in pl/sql as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <rapdrpProcessCIN:GetCINRes xmlns:rapdrpProcessCIN="http://rapdrp.com/processcin/transactional/model/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://rapdrp.com/processcin/transactional/model/1.0/"
    xmlns:N1="http://rapdrp.com/common/bodcomponents/transactional/model/1.0/"
    xmlns:N2="http://rapdrp.com/gis/cin/business/model/1.0/">
    <rapdrpProcessCIN:ApplicationArea>
    <N1:Sender>
    <N1:Id>PRT01</N1:Id>
    </N1:Sender>
    <N1:Receiver>
    <N1:CompanyName>MGVCL</N1:CompanyName>
    <N1:CompanyId>string</N1:CompanyId>
    </N1:Receiver>
    <N1:Reference>
    <N1:BODCreationDateTime>1697-02-01T00:00:00Z</N1:BODCreationDateTime>
    <N1:BusinessProcessId>BP014</N1:BusinessProcessId>
    <N1:MessageId>string</N1:MessageId>
    <N1:TransactionId>string</N1:TransactionId>
    <N1:Username>string</N1:Username>
    <N1:Token>string</N1:Token>
    </N1:Reference>
    </rapdrpProcessCIN:ApplicationArea>
    <rapdrpProcessCIN:DataArea>
    <rapdrpProcessCIN:CIN>
    <N2:CIN>string</N2:CIN>
    </rapdrpProcessCIN:CIN>
    <rapdrpProcessCIN:ConsumerNumber>string</rapdrpProcessCIN:ConsumerNumber>
    <rapdrpProcessCIN:SRNumber>string</rapdrpProcessCIN:SRNumber>
    </rapdrpProcessCIN:DataArea>
    </rapdrpProcessCIN:GetCINRes>Note the xmlns attribute of the <message> tag is "" which is unusual, but not something I can't modify.
    I wish to extract the text string of the BusinessProcessId tag. I have attempted the following:
    DECLARE
    v_result varchar2(32765);
    v_xml XMLType;
    BEGIN
    v_xml := XMLType('....above XML....');
    v_result := xmltype.extract(v_xml, '/rapdrpProcessCIN:GetCINRes/rapdrpProcessCIN:ApplicationArea/Reference/BusinessProcessId/text()','xmlns:rapdrpProcessCIN="http://rapdrp.com/processcin/transactional/model/1.0/"').getStringVal();
    dbms_output.put_line('v_result:'||v_result);
    END;
    .... and I'm receiving the following result:
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    ORA-06512: at line 6
    What am I doing wrong?
    Any help appreciated.
    Regards,
    Himani

    Hello,
    Can u please help me in resolving this issue.
    I need to parse an XML in which some tags does not contain data or there is no such tag present in an XML.
    Whenever i parse such a XML i receive error-ORA-30625: method dispatch on NULL SELF Argument is disallowed.
    As per my requirement - I may get values in all tags at one time and next time i may receive values of some fields only.
    I have tried this:
    DECLARE
    v_result varchar2(32765);
    v_xml XMLType;
    BEGIN
    v_xml := XMLType('<PurchaseOrder xmlns="http://rapdrp.com/processcin/transactional/model/1.0/">
    <Reference>SBELL-2002100912333601PDT</Reference>
    <Actions>
    <Action>
    <User>SVOLLMAN</User>
    </Action>
    </Actions>
    <Reject/>
    <Requestor>Sarah J. Bell</Requestor>
    <User>SBELL</User>
    <CostCenter>S30</CostCenter>
    <ShippingInstructions>
    <name></name>
    <address>400 Oracle Parkway
    Redwood Shores
    CA
    94065
    USA</address>
    <telephone>650 506 7400</telephone>
    </ShippingInstructions>
    <SpecialInstructions>Air Mail</SpecialInstructions>
    <LineItems>
    <LineItem ItemNumber="1">
    <Description>A Night to Remember</Description>
    <Part Id="715515009058" UnitPrice="39.95" Quantity="2"/>
    </LineItem>
    <LineItem ItemNumber="2">
    <Description>The Unbearable Lightness Of Being</Description>
    <Part Id="37429140222" UnitPrice="29.95" Quantity="2"/>
    </LineItem>
    <LineItem ItemNumber="3">
    <Description>Sisters</Description>
    <Part Id="715515011020" UnitPrice="29.95" Quantity="4"/>
    </LineItem>
    </LineItems>
    </PurchaseOrder>');
    v_result := xmltype.extract(v_xml,'/PurchaseOrder/ShippingInstructions/name/text()','xmlns="http://rapdrp.com/processcin/transactional/model/1.0/"').getStringVal();
    dbms_output.put_line('v_result:'||v_result);
    END;
    In this the value in <name></name> tag is NULL.
    Please let me know if i can parse this XML.
    Regards,
    Himani

  • Problems whilst Parsing XML with KXML2

    I have been doing a lot of reading up on the APIs of XMLPull and KXML2.
    I seem to be facing a problem which can't be solved just by reading but rather the expertise of the more experienced programmers dealing with XML parsing in J2ME.
    I know how long it takes to process an entire XML document, I just would like to parse certain parts of the document. For e.g. instead of reading the whole document, say I just want to read the first 7 items and subsequently, the next 7 items when the user clicks on the next page?
    In other words, I wish to incorporate paging. Is it possible? Or if you have an alternative solution which will not make a user wait too long, please share it!
    Can anyone help me?

    I don't think that is possible. We can't make the XML
    any smaller because it contains all the information I
    want to display. Just that I want to display it in
    pages/sections so as to reduce the load.
    So I was thinking of whether it is possible to read
    the first 5 <title> tags and next 5 for every page
    ... etcimagine that you have 20 pages so the user will have to download a 20 x 5 items xml file?
    if the user stops the navigation at page 4, he will download 16 pages for nothing so that's
    why i told you to separate the results...
    an xml file for each page and not a huge for all !

  • Parsing XML with namespaces SOLVED

    I'm working on a SOAP-based self-service UCCX/IPIVR script where the caller inputs an account number and I call a SOAP service and get an XML result. That part works great. I used this excellent article https://supportforums.cisco.com/document/97736/uccx-8x-really-simple-soap-client-no-custom-jar to accomplish that. With slight modification to work with the particular server/service, it works flawlessly.
    My return XML file has namespaces in it with multiple sections. See attached text file with the return results.I get the same result from the SOAP call from UCCX and also from SoapUI.
    First off, my Java skills are very basic at best. Also, please forgive me if I use incorrect terms when it comes to XML nomenclature.
    I need to read each <b:Bill> section and parse the various elements within each section. I can use the statement "//*[local-name()='AssessmentType']" and get the AssessmentType element from the 1st <b:Bill> section but that's it. I don't know how to access the 2nd and subsequent <b:Bill> sections. I checked a number of different articles on various sites including the forums but I haven't found anything that I can understand let alone make work. I thought using QName was going to be my answer but I can't figure out how to make that work.The more I read about this the more confused I get.
    I found a reference somewhere using //Bills/Bill[1]/AssessmentType to access the 1st section and //Bills/Bill[2]/AssessmentType to access the 2nd section but that returns null in both instances. If I use //a:Bills/b:Bill/b:AssessmentType I get an exception, prefix must resolve to a namespace a: exception in org.Apache.xpath.domapi.XPathStylesheetDOM3Exception.
    I event tried modifying the <b:Bill> tag to <b:Bill ID="1"> and using "//*[local-name()=[@ID=1]/AssessmentType" and <Bill ID="1"> but neither of those worked. I tried removing the b: from all of the elements and tried using the same syntax but I still get null.
    I'm hoping someone can point me in the right direction on how I can do what I need to do, if it's even possible. I'm sure it is, I just don't know how to go about it.
    For testing, I just hard-coded the return XML string into a String variable, converted that to a document so I could use the Get XML Document Data step to parse it. The soapResponseStringModified variable is:
    U"<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><SOAPGetBillSummaryResponse xmlns=\"http://soap.xxx\"><SOAPGetBillSummaryResult xmlns:a=\"http://schemas.xxx\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"><a:ErrorMessage i:nil=\"true\"/><a:Success>true</a:Success><a:BillCount>2</a:BillCount><a:Bills xmlns:b=\"http://schemas.xxx\"><b:Bill><b:AssessmentType>Annual</b:AssessmentType><b:BillAmount>8259.96</b:BillAmount><b:BillNumber>272818</b:BillNumber><b:BillType>Secured</b:BillType><b:IsRollover>False</b:IsRollover><b:LevyAmount>7508.24</b:LevyAmount><b:RollDate>2014</b:RollDate><b:TaxStatus>Cancelled</b:TaxStatus></b:Bill><b:Bill><b:AssessmentType>Additional</b:AssessmentType><b:BillAmount>7758.24</b:BillAmount><b:BillNumber>501340</b:BillNumber><b:BillType>Secured</b:BillType><b:IsRollover>False</b:IsRollover><b:LevyAmount>7758.24</b:LevyAmount><b:RollDate>2014</b:RollDate><b:TaxStatus>Unpaid</b:TaxStatus></b:Bill></a:Bills><a:GlobalData xmlns:b=\"http://schemas.xxx\"><b:Address>123 MAIN ST</b:Address><b:City>ANY TOWN</b:City><b:EDO>19500909</b:EDO><b:IsDelinquent>true</b:IsDelinquent><b:IsVoid>false</b:IsVoid><b:ParcelNumber>00000</b:ParcelNumber><b:State>XX</b:State><b:TaxRateArea>3016</b:TaxRateArea><b:TodaysDate>20150323</b:TodaysDate><b:Zip>00000</b:Zip></a:GlobalData><a:MainRoll>false</a:MainRoll></SOAPGetBillSummaryResult></SOAPGetBillSummaryResponse></s:Body></s:Envelope>"
    Script (run in single-step mode from the IDE):
    I appreciate any guidance.
    Bill

    It looks like I found a solution to my problem. I haven't explored this for all the possible SOAP methods I have to use but this "solution" looks encouraging.
    If I do a replace() on the namespaces for a: and b: with an empty string, then replace the a:, /a:, b: and /b: with an empty string, I can use the XPath statements //Bill[1]/<FieldName>, //Bill[2]/<FieldName>, //Bill[x]/<FieldName> I can extract the data in a loop since I know the total number of bills ahead of time.
    I replace xmlns:a="http://schemas.xxx" and xmlns:b="http://schemas.xxx" with "", I can extract the elements in the Bill tags.
    It looks like this will solve my problem. It's not elegant but it works. When I loop through the elements, they' re updating appropriately based on the returned XML response.
    I'm sure there's a more elegant way to solve this problem but based on my limited coding skills, I found this a workable solution. I don't know how to use all the various Java tools available to me so this does the job.
    If someone knows the proper way to do this, I'd like to know how it's done. This will add to my toolkit and make my code easier to maintain down the road.
    Bill

  • Parsing xml with dom4j - cannot find jar file

    Hi,
    I'm using Jdeveloper 10g and tomcat 5.5.9. I have a servlet which calls a java class (ParseXML.java) that trys to parse an xml string using dom4j. A snippet of ParseXML.java...
    import org.dom4j.Document;
    import org.dom4j.DocumentException;
    import org.dom4j.io.SAXReader;
    public class ParseXML  {
    public ParseXML(String xml) {
              this.XML_STRING = xml;
         public String parse() {
              SAXReader reader = new SAXReader();
              Document document = null;
              try  {
                   document = reader.read(XML_STRING);
                   } catch (DocumentException de)  {
                   return de.getMessage();
              } catch (Exception e) {
                   return e.getMessage();
                   return "The xml root value is: " + document.getRootElement().getName();
    } I've downloaded the dom4j 1.6.1 jar and put it on the project class path (specified in the jdev project proerties), and my code also compiles ok. But when i try to instantiate ParseXML from my servlet i get a runtime exception:
    javax.servlet.ServletException: Servlet execution threw an exception
    root cause
    java.lang.NoClassDefFoundError: org/dom4j/DocumentException
         arcims.GetMapServlet.doPost(GetMap.java:45)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802I'm not sure if this is a class path issue or something else; i've checked and rechecked the classpath and nothing seems amiss.
    Suggestions, anyone?

    Question: Is it really necessary to use a
    StringReader if my xml document is not saved to disk?
    I get XML_STRING from a web service, convert it into
    a xml document so i can manipulate/parse it, but then
    i don't save the document, i just discard it. How
    does my system's default character set affect string
    manipulations that i do within my java app?Your system's default charset doesn't have anything to do with string manipulations, if by that you mean substrings and concatenations of strings. It is used when you convert strings to bytes and bytes to strings. If your string contains a character that can't be handled by your default charset, then converting that string to bytes will put ? in place of that character. Converting those bytes back to a string will leave the ? as is. Thus your string has been changed.
    Also converting the string to bytes can have bad results, because the first thing the XML parser does is to convert the bytes back to a string, using the charset declared in the XML. If this charset is different from your system's default, then your XML may be corrupted by this process if it contains characters that are encoded differently in the two charsets. The typical example of this is European accented letters like �, which are encoded differently in ISO-8859-1 or Windows-1252 (most people's default charsets) and UTF-8 (the default XML charset).
    Besides, converting the string to bytes just so it can be immediately converted back to a string is rather wasteful.

  • XML with HTML Tags... (easy points) 11g question

    Dear Programming Gods,
    I have been researching this for about 2 weeks now, and I have hit the final road block.
    Using BI Publisher 11.1.1
    In APEX 4.0 I have a Rich Text Field. The data from the Rich Text Field is store in CLOB. The data has HTML formatting tags. I have a data model that selects the data. I create an xml which has the html tags. I export the xml and import it into MS Word using the BI Publisher add-in. I import my subtemplate which handles almost all of the formatting tags. I apply the template to the CLOB field so that the HTML formatting tags will be rendered when printed.
    The problem is this. The subtemplate is looking for this < and / > however BI publisher convters the tags stored in the CLOB from raw html tags to this &.lt; and &.gt; so the subtemplate can not match to it.
    Here is what I need to figure out and please explain it in very novice terms.
    When I generate and export the XML from BI Publisher how do I prevent it from converting my raw tags?
    Here is some further assistance when prepairing your answer.
    My subtemplate is based on the htmlmarkup.xsl from the following blog but has been modified heavily to include support for simple tables, more formatting such as subscripts and superscripts, ect...
    http://blogs.oracle.com/xmlpublisher/2007/01/formatting_html_with_templates.html
    I am also familliar with this blog but I do not understand how to implement it using BI 11g.
    http://blogs.oracle.com/xmlpublisher/2009/08/raw_data.html
    I have tried adding this to my layout but it doesnt seem to work.
    <xsl: element name="R_CLOB" dataType="xdo:xml" value="R_CLOB" / >
    Please, help me. I have to have this working in 4 days.
    Richard

    This did not work either. Here's more infor on what I have so far.
    My data template looks like this:
    <dataTemplate name="Data" description="Template">
         <parameters>
              <parameter name="p_person_id" dataType="character" defaultValue="1"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="Q1">
                                  select TEMPORARY_TEMPLATE_DATA.line_id as LABEL_line_ID,
    TEMPORARY_TEMPLATE_DATA.column_id as LABEL_column_ID,
    TEMPORARY_TEMPLATE_DATA.person_id as LABEL_PERSON_ID,
    TEMPORARY_TEMPLATE_DATA.label as LABEL_DATA
    from MY_BIO.clm_TEMPORARY_TEMPLATE_DATA TEMPORARY_TEMPLATE_DATA
    Where person_id = :p_person_id
    and style = 'L'
                             </sqlStatement>
              <sqlStatement name="Q2" parentQuery="Q1" parentColumn="LABEL_DATA">
                                  select TEMPORARY_TEMPLATE_DATA.LINE_ID as LINE_ID,
    TEMPORARY_TEMPLATE_DATA.COLUMN_ID as COLUMN_ID,
    TEMPORARY_TEMPLATE_DATA.label as COLUMN_LABEL,
    to_nclob(TEMPORARY_TEMPLATE_DATA.COLUMN_DATA) as  COLUMN_DATA,
    TEMPORARY_TEMPLATE_DATA.STYLE as STYLE,
    TEMPORARY_TEMPLATE_DATA.ATTRIBUTE as ATTRIBUTE,
    NVL(TEMPORARY_TEMPLATE_DATA.JUSTIFY,'L') as JUSTIFY
    from MY_BIO.clm_TEMPORARY_TEMPLATE_DATA TEMPORARY_TEMPLATE_DATA
    Where person_id =:p_person_id
    and label = :LABEL_DATA
    and style != 'L'
    Order by line_id, column_id
                             </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_LABEL" source="Q1">
                   <element name="LColumnData" value="label_data"/>
                   <group name="G_DATA" parentGroup="G_Label" source="Q2">
                        <element name="LineID" value="line_id"/>
                        <element name="ColumnID" value="column_id"/>
                        <element name="ColumnData" value="column_data"/>
                        <element name="Style" value="style"/>
                        <element name="Attribute" value="attribute"/>
                        <element name="Justify" value="justify"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>
    After running this data_template there was no change in the xml file generated see partial :  Note:
    my test actually has the B with the html tags
    </G_DATA>
    - <G_DATA>
    <LINEID>20</LINEID>
    <COLUMNID>1</COLUMNID>
    <COLUMNDATA>test test <B>my test</B></COLUMNDATA>
    <STYLE>R</STYLE>
    <ATTRIBUTE />
    <JUSTIFY>C</JUSTIFY>
    </G_DATA>
    - <G_DATA>
    <LINEID>21</LINEID>
    I loaded in to MS Word but there was no change documnet still look the same. I left the commands import file command and xsl:apply-templates command in the word document template.
    I really appreciate you helpiing me.
    cheryl

Maybe you are looking for

  • LSMW Vendor XK01 Session Failed to create

    Hi all, I am trying to upload vendor data using LSMW using direct batch program RFBIKR00 . Would like to store Compnay code level details also. I did have Compnay code 0001  in FIle..I checked Converted data also, but getting below error .... FB012  

  • Credit Terms with Grace Period in Credit Management -

    Team, I want to know how to define the following: Credit Terms: Net 30 days Grace Period: 5 days The systems  should not  put Sales Orders on 'credit hold' upto 35 days. On the 36th day (and beyond) Sales Orders should be put on 'credit hold' by the

  • "Where is Keychain Scripting?" Mountain Lion edition

    This came back to haunt me from the Lion days. I launch the newly renamed Contacts app, and within a few seconds a "Choose Application" dialog with the caption "Where is Keychain Scripting?" pops up. But this time, nothing is clickable - I get a Spin

  • Cursor placement in a Reply

    Something that's always bothered me is how Apple Mail places the cursor directly above the quote line when replying to a new message, as below: *+(cursor is here)+* *+On Jan 11, 2011, at 8:49 AM, John Doe wrote:+* Is there a plist modification that w

  • Firefox takes forever to close

    Firefox often takes forever to close. It doesn't hang or crash, because eventually it will close, but it may take 15 or 20 minutes. (At least it seems that way.) The problem seems more likely whenever: - I've had Firefox open for a long time, - I've