AJAX-XML question

Hi everybody,
I don�t know if this is the right place for this question:
I�ve followed this example:
https://bpcatalog.dev.java.net/nonav/ajax/autocomplete/design.html
it works great, but I have one question about it
when the xml is generated:
sb.append("<employee>");
sb.append("<id>" + e.getId() + "</id>");
sb.append("<firstName>" + e.getFirstName() + "</firstName>");
sb.append("<lastName>" + e.getLastName() + "</lastName>");
sb.append("</employee>");
it doesn�t work for IE if any of those attributes has
strange characteres like: ���� (spanish characters)
(it doesn�t work for IE, for firefox it does)
I need those characters in my XML.
For example, I need something like:
<employee>
<id>23</id>
<firstName>Jos�</firstName>
<lastName>G�mez</lastName>
</id>
</employee>
does anybody know how can I do this?, any idea?
thanks for your time

it doesn�t work for me
               sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
               sb.append("<provincias><provincia><nombre>");
               sb.append("Alcal�");
               sb.append("</nombre><id>3324</id></provincia></provincias>");          
               byte byteContent[] = sb.toString().getBytes("UTF-8");
               response.getWriter().write(new String(byteContent,"UTF-8"));
thanks

Similar Messages

  • Where to ask XML-questions

    Hello,
    when I have a question about XML, where do I ask?
    XML DB issues related to XML DB
    XML  space for the following subspaces
    General XML  Discussion of the general XML language, standards (XSLT, XQuery, XMLSchema, etc.) and application management issues, suggestions and tips.
    PL/SQL XML Programming  PL/SQL programming using XDK and related management issues inside Oracle database server. Any question for XML DB functionality, please post your question in Products -> Database-> XML DB.
    XQuery Discussion of Oracle XQuery Technology Preview, W3C XQuery specifications, and JSR 225: XQuery API for Java (XQJ) issues
    I think I now have an idea (not that I'm sure about it) where my question will fit best. Now, because there is an explanation of the scope of the space, I don't remember something like this in the old forum. Nevertheless it might be confusing for a new member or one that lacks a certain knowledge about the subtleties:
    One step forward everyone who understands the explanation for the PL/SQL XML Programming space!
    When I have a question about XQuery, how can I decide whether XQuery is correct or General XML?
    Which questions qualify for XML DB and not for any of the others.
    We all know that many users are not able to see that SQL questions don't belong into the SQL Developer space, how can we expect that they will find the "correct" forum for XML questions? In the end they will end up in the SQL and PL/SQL space anyhow :-)
    Regards
    Marcus

    My $0.02.
    As I recall, the explanation for each forum was at the entry level for each forum and not displayed within the forum itself.
    The PL/SQL XML Programming space refers to the Oracle XML Developer Kit.  It is maintained by a different team than the XMLDB so the need for a separate space for it makes sense.  That said, what it covers is also part General XML and XQuery if you dig into what you can do in the XDK.
    Some questions that would qualify for the XML DB space.
    Anything related to schema registration or downstream of schema registration.  Such as querying/performance/indexes/etc.
    Issues parsing XML via using XMLTable (or XQuery, such as the new XQuery update added in 11.2.0.3) (Yes that can conflict)
    Storage of data in XMLType columns
    I to have always been a bit unclear on the exact division between groups in this XML space.  I see the XQuery space as being a subset of the General XML space.  I watch all three forums, as they are normally low volume and you never know where a question will pop up.  As you have seen, questions often end up in the wrong forum and often General XML gets an influx of questions that should go into the Business Intelligence space as well.  There is no good way right now to start a generic post and let the system suggest forums that the post could go into, based on content or software involved.  That would be a nice touch for the future.

  • Follow-up Basic XML Questions

    First, I apologize to the board in advance because I started a very similar topic already. I know this can be annoying but I think I'm worried that people will ignore my original post because there was already a reply to it. I added 2 follow up posts and nobody has responded. It could well be because they feel that my questions were already answered. After reading and re-reading the person who replied to my original question I did start to pick up many answers from his post. However, I guess I have some follow-up questions and felt compelled to start a new thread to get this "out there" again. I promise to try not to do this again and, once again, I apologize for starting multiple similar topics. Anyway, here goes my follow-up questions...
    I'm pretty new to XML but I've been reading an article on msdn about it and listed some code from the article at the bottom of this post.
    I have some questions about namespaces. From what I understand, a namespace is a unique identifier (it's a string). The thing that's bugging me though is this line...
    <x:transform version='1.0' xmlns:x='http://www.w3.org/1999/XSL/Transform'>
    Maybe I'm wrong, but my gut feeling is that this particular namespace has a special meaning (in other words, it goes beyond being just a unique identifier). Am I correct on this?
    From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically. I've read that a schema can be "namespace aware". So, as a guess at the answer to my original question - are there certain namespaces that are something like "keywords" (similar to the concept of "keywords" in programming languages)? And is the "big deal" about these particular namespaces that they have schema definitions attached to them somehow? Any help would be GREATLY appreciated!
    EXAMPLE CODE FROM THE MSDN SITE:
    <x:transform version='1.0'
    xmlns:x='http://www.w3.org/1999/XSL/Transform'
    >
    <x:template match='/'>
    <hello_world/>
    </x:template>
    </x:transform>

    this particular namespace has a special meaning .... Am I correct on this?Yes, that namespace has a "meaning", but only to a program that implements the XSLT language. Likewise a "purchase order" namespace has a "meaning", but only to a program that is designed to read XML with that namespace and convert it to purchase orders in somebody's accounting system. (Just as the codes 'A', 'C', and 'D' could mean 'Add', 'Change', and 'Delete' to a program that maintains a database.) Similarly element names have a "meaning", but only to a program that is designed to understand that "meaning". A Java program has a "meaning" but a COBOL compiler doesn't understand that "meaning".
    From other stuff I've read I have another gut feeling that there are certain namespaces that somehow have schemas attached to them automatically.Not that I've ever heard of.

  • XSLT, XML Question???

    I've recently found that I can use XSLT to transform XML docs into SQL using x-path... Is there any documentation out there referencing a transformation using x-query???? I've searched the web but have not seem much on this...
    Any direction would be greatly appreciated.

    XSLT doesn't use XQuery. So it's not surprising you haven't found much documentation about using XQuery in XSLT. You might want to direct questions like this one to an XSLT forum rather than a Java forum.

  • XMLTYPE variable converting to XML (Question)

    Friends,
    I am stuck on an error and cannot find a way out. Please help. I know it's a long question but a very simple answer to many smart people here. I am just lost and need your help. (I am new to SOA so bear with me)
    I have a BPEL process which invokes a PL/SQL API which returns the XMLTYPE output which has the XML data. In order to convert the XMLTYPE to normal XML I do following :-
    - I added a Java embed activity in BPEL with following code (Invoke_new_get_customer_order_info_OutputVariable','OutputParameters','/ns2:OutputParameters/ns2:X_CUSTOMER_ORDER_INFO_XML is the XMLTYPE)
    (responsePayoad is string variable)
    try{                                                           
    Node node = (Node)getVariableData("Invoke_new_get_customer_order_info_OutputVariable','OutputParameters','/ns2:OutputParameters/ns2:X_CUSTOMER_ORDER_INFO_XML");
    Node childNode = (Node) node.getFirstChild();
    StringWriter writer = new StringWriter();
    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    transformer.transform(new DOMSource(childNode), new StreamResult(writer));
    String xml = writer.toString();
    String nsXML = xml.replaceFirst("<FetchCustomerInfoResponse","<FetchCustomerInfoResponse xmlns=\"http://xmlns.djoglobal.com/OrderTracking/CustomerInfo\" ");
    setVariableData("responsePayload",nsXML);
    addAuditTrailEntry("XML with Namespace: " + nsXML);
    } catch(Exception e){                            
    addAuditTrailEntry(e);
    System.out.println("Namespace injection failed due to : " + e);
    After above I have ASSIGN activity where I use parsexml function on the "responsePayload" variable to assign to a variable of type element which refers to following xsd. This is where I get an "internal xpath error" during runtime which I cannot resolve.
    XSD of the element variable refering to "FetchCustomerInfoResponse" element
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org"
    targetNamespace="http://xmlns.djoglobal.com/OrderTracking/DJOFetchCustomerOrderInfo"
    elementFormDefault="qualified">
    <xsd:element name="FetchCustomerInfoResponse">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="DJO_ONT_ACCOUNT_ORDERS">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="DJO_ONT_ACCOUNT_ORDER" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:attribute name="ordered_date" type="xsd:string"/>
    <xsd:attribute name="cust_po_number" type="xsd:string"/>
    <xsd:attribute name="order_number" type="xsd:integer"/>
    <xsd:attribute name="header_id" type="xsd:integer"/>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    XML returned in the XMLTYPE from the PL/SQL API :-
    <Invoke_new_get_customer_order_info_OutputVariable><part name="OutputParameters" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/XXDJO_ONT_ORDER_TRACKING_WS/GET_CUSTOMER_ORDER_INFO_XML/"><X_CUSTOMER_ORDER_INFO_XML>
    <FetchCustomerInfoResponse xmlns="">
    <DJO_ONT_ACCOUNT_ORDERS>
    <DJO_ONT_ACCOUNT_ORDER ordered_date="24-APR-12" cust_po_number="PO1" order_number="123456" header_id="7777777"/>
    <DJO_ONT_ACCOUNT_ORDER ordered_date="19-APR-12" cust_po_number="PO2" order_number="4545454" header_id="888888"/>
    <DJO_ONT_ACCOUNT_ORDER ordered_date="09-APR-12" cust_po_number="PO3" order_number="56565656" header_id="999999"/>
    </FetchCustomerInfoResponse>
    </X_CUSTOMER_ORDER_INFO_XML>
    </OutputParameters></part></Invoke_new_get_customer_order_info_OutputVariable></messages>
    Any help is greatly appreciated as this is driving me nuts.
    Thanks

    Few modifications,
    1. Initialize your int count to 0, int count=0;
    2. Write count++; as the first statement in your for loop. 3. Remove count++; at the bottom.
    4. Add a hidden field to your form (after submit button, but before your </form> tag)
    <input type="hidden" name="qCount" value="<%=count%>">
    Now use this code,
    writeXML.jsp
    <%
    int qCount = Integer.parseInt(request.getParameter("qCount"));
    String home ="C:\\Tomcat\\FYProject\\lib\\";
    String filename = request.getParameter("file");
    String extension = ".xml";
    String filePath = home + filename + extension;
    BufferedWriter bw = new BufferedWriter(new FileWriter(filePath,true));
    bw.write("<mc_QuestionType>");
    bw.newLine();
    for(int count=0;count<qCount;count++) {
         String Tquestion = request.getParameter("questionText"+count);
         String answer1 = request.getParameter("choice_1"+count);
         String answer2 = request.getParameter("choice_2"+count);
         String answer3 = request.getParameter("choice_3"+count);
         String answer4 = request.getParameter("choice_4"+count);
         String Canswer = request.getParameter("cAnswer"+count);
         bw.write(" <questionText>" Tquestion "</questionText>");
         bw.newLine();
         bw.write(" <choice>" answer1 "</choice>");
         bw.newLine();
         bw.write(" <choice>" answer2 "</choice>");
         bw.newLine();
         bw.write(" <choice>" answer3 "</choice>");
         bw.newLine();
         bw.write(" <choice>" answer4 "</choice><br>");
         bw.newLine();
         bw.newLine();
         bw.write(" <answer>" Canswer "</answer>");
         bw.newLine();
         bw.write("</mc_QuestionType>");
         bw.close();
    %>Hope this works.
    Sudha

  • Sun-faces-config.xml question

    Hello all,
    maybe this question is a bit silly, but i�m a newbie to this. I�m developing a complib file with a custom component; and I want to add custom properties to it. As far as I�ve done, i�m able to add custom string properties via the "StringPropertyEditor"
    All this is done in the sun-faces-config.xml file, and when I declare a property which can be set via a combo-box, this is, with a "SelectOneDomainEditor" in the sun-faces-config.xml, I don�t know how to populate this combo with data to be shown so it can be selected in the properties window.
    I�d be truly grateful to anyone who can help me out, maybe a short sample or fraction of a sun-faces-config would be fine.
    Thanks everyone in advance, and sorry for the long read,
    MANUEL ANS�N.

    Hi ,
    The follwing link may probably answer your query.
    http://swforum.sun.com/jive/thread.jspa?threadID=50215&tstart=15
    Regards.,

  • JSP Ajax XML problem

    Hi !
    i am creating a program using JSP Ajax to read PUBLIC enteries of Google calender but when i run to check the JSP file that is Server Side process & return result to HTML i got the following result:
    375/-+1750/-Bunty [email protected]://www.google.com/calendar/feeds/bunty.india%40gmail.com/public-031eeb071629562bb65d8d446f5f2b59/basic/n21nl92hsg9mljbv0ntsrlrhp42006-11-14T10:12:59.000Z2006-11-14T10:13:22.000ZWhen: 2006-11-14 <br> <br>Event Status: confirmedWhen: 2006-11-14 <br> <br>Event Status: confirmedBunty [email protected]://www.google.com/calendar/feeds/bunty.india%40gmail.com/public-031eeb071629562bb65d8d446f5f2b59/basic/o7ttfhhs2fbsjl34m08026h2102006-11-14T10:11:31.000Z2006-11-14T10:12:05.000ZWhen: 2006-11-17 13:00 to 14:00  IST <br> <br>Event Status: confirmedWhen: 2006-11-17 13:00 to 14:00  IST <br> <br>Event Status: confirmedBunty [email protected]://www.google.com/calendar/feeds/bunty.india%40gmail.com/public-031eeb071629562bb65d8d446f5f2b59/basic/kir9gd7c9gkf6va0283oicbivc2006-10-04T14:00:37.000Z2006-10-04T14:00:37.000ZWhen: 2006-10-15 17:00 to 18:30  IST <br> <br>Event Status: confirmedWhen: 2006-10-15 17:00 to 18:30  IST <br> <br>Event Status: confirmedBunty [email protected]://www.google.com/calendar/feeds/bunty.india%40gmail.com/public-031eeb071629562bb65d8d446f5f2b59/basic/6d628dcmei9f3kd2c705i282o02006-09-28T09:08:26.000Z2006-10-04T13:59:43.000ZWhen: 2006-10-07 10:00 to 11:00  IST <br> <br>Event Status: confirmedWhen: 2006-10-07 10:00 to 11:00  IST <br> <br>Event Status: confirmedBunty [email protected]://www.google.com/calendar/feeds/bunty.india%40gmail.com/public-031eeb071629562bb65d8d446f5f2b59/basic/i4o0s31ia8cuau5gn3l6ecvd582006-09-19T11:04:10.000Z2006-09-25T10:16:06.000ZWhen: 2006-10-15 15:00 to 16:00  IST <br> <br>Where: Rajouri Garden <br>Event Status: confirmedWhen: 2006-10-15 15:00 to 16:00  IST <br> <br>Where: Rajouri Garden <br>Event Status: confirmedBunty [email protected]://www.google.com/calendar/feeds/bunty.india%40gmail.com/public-031eeb071629562bb65d8d446f5f2b59/basic/vfu1bbrickckleptoh46m3v09k2006-09-25T10:15:19.000Z2006-09-25T10:15:19.000ZRecurring Event<br> First start: 2006-09-27 IST <br> Duration: 86400 <br>Event Status: confirmedRecurring Event<br> First start: 2006-09-27 IST <br> Duration: 86400 <br>Event Status: confirmedBunty
    But it should be a proper XML file.....
    HTML Code:
    function RSSRequest() {
         // change the status to requesting data
         HideShow('status');
         document.getElementById("status").innerHTML = "Requesting data ...";
         // Prepare the request
         RSSRequestObject.open("GET", rssReader.jsp, true);
         // Set the onreadystatechange function
         RSSRequestObject.onreadystatechange = ReqChange;
         // Send
         RSSRequestObject.send(null);
    <body onload="RSSRequest();">
    <h2>Google Calendar Events - RSS Reader- BuntyIndia</h2>
    <div id="status" style="display:none"></div>
    <div id="ajaxreader"></div>JSP Code:
    <%@ page import = "java.io.*, java.util.*,java.net.URL,java.net.*,java.awt.*" %>
    <%
    URL url = new URL(" http://www.google.com/calendar/feeds/bunty.india%40gmail.com/public-031e071629562bb68d446f5f2b59/basic");
    URLConnection urlConnection = url.openConnection ( ) ;
    StringBuffer stringbuffer = new StringBuffer("");
    String news =new String();
    try {
    BufferedReader in = new BufferedReader ( new InputStreamReader (url.openStream())) ;
    while((in.readLine())!= null)
    //s2=in.readLine();
    stringbuffer.append(in.readLine());
         in.close();
    catch(Exception e) {
         System.out.println(e.getMessage());
    news=stringbuffer.toString();
    out.println(news);
    //response.setContentType("text/xml");
    //response.setHeader("Cache-Control", "no-cache");
    //response.getWriter().write(in);
    %>Please Help
    Bunty India

    displaying blank page....
    where to check LOG file what's the path?
    i changed my code little bit placed response.setContentType at top know my page is displaying XML error
    XML document must have a top level element. Error processing resource
    <%@ page import = "java.io.*, java.util.*,java.net.URL,java.net.*,java.awt.*" %>
    <%
    response.setContentType("text/xml");
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("pragma","no-cache");
    URL url = new URL("http://www.google.com/calendar/feeds/bunty.india%40gmail.com/public-031e071629562bb68d446f5f2b59/basic");
    URLConnection urlConnection = url.openConnection ( ) ;
    StringBuffer stringbuffer = new StringBuffer("");
    String news =new String();
    try {
    BufferedReader in = new BufferedReader ( new InputStreamReader (url.openStream())) ;
    while((in.readLine())!= null)
    //s2=in.readLine();
    stringbuffer.append(in.readLine());
         in.close();
    catch(Exception e) {
         System.out.println(e.getMessage());
    //news=stringbuffer.toString();
    //out.println(news);
    //log(news);
    //System.out.println(news);
    response.getWriter().write(news);
    %>
    Message was edited by:
    bunty_india
    Message was edited by:
    bunty_india
    Message was edited by:
    bunty_india

  • PMW - XML question

    Hello folks,
    we are currently working on the creation of an XML based payment medium.
    As far as I can see, the tags are generated automatically:
    <tag>content</tag>
    My question, I need to adapt the <tag> names as follows:
    <tag somefilename="xxxx.xml"></tag>
    I have the following problems: The file name should be automatically generated via document number or identifier (i.e. "1900000054.xml") which is changing for every transaction. Therefore, I need to have some sort of variable within the tag name. But it doesn't even allow me to enter a space within the name, so I guess I have to flag that tag differently.
    Is that at all possible? Otherwise we would need to switch back to a plain flat file and that's not a very nice solution.
    Many Thanks in advance for help/advice,
    Thomas

    Hello Thomas,
    what you are describing looks like an Attribute. Try to create an Attribute "Filename" under your Element "Tag". For the "Filename" you can then define any source again.
    Regards,
    Anton.

  • Spry XML question

    can spry read in XML as a string? I have an xml page
    generated by a coldfusion query (.cfm) The page parses correctly as
    an XML file, but when spry reads it in, it does not read it as XML.
    I can save the .cfm results (view source) as an XML file and it
    views perfectly through spry. Wondering if there is a way to do
    this with the original cfm file. NOTE: the example linked
    here
    does not work

    I use CF to generate XML all the time.
    You have to make sure you set the content-type to XML and
    make sure to remove whitespace:
    http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html
    But to answer your questions: yes, Spry can read XML strings:
    http://labs.adobe.com/technologies/spry/samples/data_region/XMLStringSample.html
    Hope this helps.
    Don

  • Spry Repeat/XML question

    I am in desperate need of help.
    Here is the path to my html file.
    http://www.3hounddesign.com/WoodsWoods/gallery/index.html
    When you look at it, you see the navigation list on the left
    (Adobe, SF Symphony, Fiery, etc). This list corresponds to the
    images that you see. However some of the navigation items (Adobe,
    Apple, Levi Strauss) have more than one image associated with them.
    I want to be able to use the arrows at the bottom of the page to
    click through to the second image, but not have it show up on the
    navigation list. For example, I only want Adobe to show up once on
    the navigation list, even though I have 2 different adobe photos,
    and thus have created 2 different XML entries for Adobe.
    http://www.3hounddesign.com/WoodsWoods/gallery/galleries/woods/photos.xml
    The first entry has the Adobe title, while I left the second
    one blank. However this leaves a blank space on the navigation
    list.
    Unfortunately I know very little about javascript and am just
    learning about this spry stuff and am very confused, and therefore
    created this stuff by altering the adobe gallery demo
    I also have a version I created by altering the adobe
    products demo (
    http://www.3hounddesign.com/Paul_Woods/identity.html#)
    However that has problems of its own, so I would rather stick
    with my alteration of the gallery demo.
    So basically my question...Is there any way that I can have
    the navigation only show one entry for Adobe (and Apple and Levi)
    yet still have two images there?
    Sadly, I am desperate need of an answer ASAP, as a current
    job I am working on depends on it, and I don’t want to have
    to resort to iframes.
    Please please someone help me!

    Hi,
    I looked over you code and I noticed that you have the image
    src added on the left side.
    You have this <img
    src="galleries/{dsGalleries::@base}{dsGallery::thumbnail/@base}{@thumbpath}"
    alt="{@thumbpath}" name="tn{ds_RowID}" width="89" height="15"
    id="tn{ds_RowID}" style="left: -77px; right: 0px;" />
    You don't need to have the image added on the left side,
    because you want there only the title (Adobe, SF Symphony...)
    So you should replace the img with a div for example:
    <div style="width:89px; height:15px;left: -77px; right:
    0px;" id="tn{ds_RowID}" >{@thumbpath}</div>
    The reason why you have an empty space after Adobe item is
    that on you xml you have an empty alt attribute.
    To display only the thumbpaths that are not empty you can add
    an spry:if condition.
    So the above div becomes:
    <div style="width:89px; height:15px;left: -77px; right:
    0px;" id="tn{ds_RowID}" spry:if="{@thumbpath}" != ""
    >{@thumbpath}</div>
    This says if thumbpath is not empty display it.
    I aslo load you page in IE and I noticed that the left menu
    is not displayed.
    Diana

  • Very basic SQL/XML question

    I'm using the following environment:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    However, I don't think my environment is the issue.
    I'm trying to get output which looks like this from a simple table:
    <MAXDOMAIN action="S">
         <DOMAINID key="true">domainid_data</DOMAINID>
         <SYNONYMDOMAIN type="relationship" action="AU" >
              <VALUE key="true">value_data</VALUE>
              <MAXVALUE>maxvalue_data</MAXVALUE>
              <DESCRIPTION>description_data</DESCRIPTION>
              <DEFAULTS>defaults_data</DEFAULTS>
         </SYNONYMDOMAIN>
    </MAXDOMAIN>The table looks like this
    Name                           Null     Type          
    DOMAINID                       NOT NULL VARCHAR2(30)   
    DESCRIPTION                             VARCHAR2(50)   
    DOMAINTYPE                              VARCHAR2(5)    
    MAXTYPE                                 VARCHAR2(5)    
    LENGTH                                  VARCHAR2(5) The real question is how do I get an element with attributes to also have content.
    <DOMAINID key="true">domainid_data</DOMAINID>and
    <VALUE key="true">value_data</VALUE>I'm not sure if I'm syntactically challenged or just not using the correct tags.
    If I try to just generate the first two tags, forgetting the following nesting, I'm OK, as long as I don't try to assign attributes to the DOMAINID tag:
    SELECT  XMLELEMENT
    ("MAXDOMAIN",XMLATTRIBUTES('S' AS "action"),XMLELEMENT(NAME DOMAINID, "DOMAINID")
    AS "RESULT"
    FROM FAC_MAXDOMAIN;This works and is pretty trivial.
    <MAXDOMAIN action="S"><DOMAINID>AIRFLOWTYPE</DOMAINID></MAXDOMAIN>
    etc, etc...However, this:
    SELECT  XMLELEMENT
    ("MAXDOMAIN",XMLATTRIBUTES('S' AS "action"),XMLELEMENT(NAME DOMAINID, "DOMAINID",XMLATTRIBUTES('true' AS "key"))
    AS "RESULT"
    FROM FAC_MAXDOMAIN;Yields an ORA-00907: missing right parenthesis error.
    Any ideas? maybe a good primer on SQL/XML might be the best solution...
    TIA,
    Paolo

    Very nice for a first post in terms of data included and formatting.
    It took me a few minutes to see it, but the simple answer is you are putting the XMLAttributes in the wrong location. See the XMLElement spec at http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions220.htm#SQLRF06168 that shows XMLAttributes comes between the identifier and value. So that means you should have written it as
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
    SQL> WITH FAC_MAXDOMAIN AS
      2  (SELECT 'domainid_data' domainid, 'dscr' description,
      3          'type' domaintype, '10' maxtype, '5' length
      4     FROM dual)
      5  -- Using WITH so didn't have to create your table locally
      6  SELECT  XMLELEMENT("MAXDOMAIN",
      7            XMLATTRIBUTES('S' AS "action"),
      8            XMLELEMENT(NAME DOMAINID, XMLATTRIBUTES('true' AS "key"), "DOMAINID")
      9          )
    10  AS "RESULT"
    11  FROM FAC_MAXDOMAIN;
    RESULT
    <MAXDOMAIN action="S"><DOMAINID key="true">domainid_data</DOMAINID></MAXDOMAIN>

  • AJAX Tab question

    Hi All,
    I have CF 8 Standard and have used the Ajax tabs (I suppose these are from Yahoo). I have been able to properly display tabs on my CFM page and the users are able to navigate using these tabs. Is there a way for me to know what tab the user clicks? I have a common area (like a <div>) above the tabs. I would like to show relevant information in the DIV depending on the tab the user clicks on.
    Thanks.
    - Milind Joshi

    I'm answering my own question. Giving it here so if anyone else was in similar situation, he/she would know what to do. My requirement was to capture the tabchange event. I wanted to know what tab the user navigated to.
    Here's what I did:
    1) Put following line almost at the end of the page.
    <cfset AjaxOnLoad("loadTabListener")>
    This fires the function loadTabListener when the page is gets loaded in the browser.
    2) Put this in the header block. This returns an Ext JavaScript object. The second line adds an event listener to the Ext JavaScript object named "datatabs" and fires the event handler.
    loadTabListener = function() {
       tabObj = ColdFusion.Layout.getTabLayout("datatabs");
       tabObj.addListener('tabchange', getClickedTab);
    3) Put these lines of code below the above declaration.
    getClickedTab = function(objParent, objPanel) {
       //objPanel.getText() gives you the title of the tab.
       parent.showMenu(objPanel.getText());
    Now, you can do whatever you want to do depending on what tab the user navigated to. In my case, I wanted to dynamically change the hyperlinks in a certain area depending on what tab the user was. For more info on the JS libraries used for tabs CF go to http://www.extjs.com/deploy/ext/docs/
    Bye for now.
    - Milind

  • Naive xml question

    hi,
    i'm new to xml and i need to create a data base in xml which is supposed to store patient records.
    The question is:
    Should all patient records be stored in the same file or should each patient record be stored in a different file?
    In the latter case how do we search for records given (for instance) the patient's name?
    Thanks,
    Nikolas.

    Hi pete,
    I see you know alot on the subject, what exaclty does your job entail? Does your company do any summer interships :-) ? Mehti & I are undergraduates in our second year of computer science at University College London and have been assigned this group project. Part of it involves making an xml "database" to store patient records for a phoney hospital system. From the requirements it would seem that an archive system would be preferable:
    Users, after identifying themselves, would retrieve files from the archive, edit them & replace them...
    In that respect, this isn't actually a relational database at all!
    >If you absolutely
    absolutely must only use XML, then you can create the
    index as an RDF/XML file and so query that. Since the
    records are simple files on the file system you may
    have more work to guarentee data integrity and
    security.
    This seems like what we would want to do. However what does an RDF/XML file look like? It indexes the paths to the files on the system right?
    > A compromise might be to use a CVS behind a web
    server to manage the access to the records- you can
    then fire a trigger on any updates to the record and
    re-index as required, and the interface is more
    secure.
    I personally don't have much experience with CVS (I do however have an idea about what it's about). However as it would definetly garantee the integrity of the file system we will try learning about it and find out how we could implement it.
    I think for the moment, we will satisfy ourselves with a repository of patient records as separate files and try to garantee security and integrity of the file system through CVS.
    Thanks Pete,
    Nikolas.

  • Simpe XML question.  You can make yourself look smart!

    I have the following xml file:
    <?xml version="1.0"?>
    <ToolConfig>
         <database_info></database_info>
         <spelling_info></spelling_info>
         <server_info></server_info>
         <concept_list></concept_list>
    </ToolConfig>I have the following java program:
    import java.io.*;
    import org.w3c.dom.*;
    import org.apache.xerces.parsers.DOMParser;
    import org.xml.sax.SAXException;
    public class ConfigParams
        public ConfigParams()
            String configFile = new String("C:\\tomcat\\webapps\\QueryTool\\WEB-INF\\ToolConfig.xml");
            try
                DOMParser parser = new DOMParser();
                parser.parse(configFile);
                org.w3c.dom.Document configDoc = parser.getDocument();
                NodeList nodeList = configDoc.getChildNodes();
                for (int j=0; j<nodeList.getLength(); j++)
                    System.err.println(j+": "+nodeList.item(j).getLocalName());
                System.err.println("-----");
                Node topNode = nodeList.item(0);
                NodeList sectionNodes = topNode.getChildNodes();
                for (int j=0; j<sectionNodes.getLength(); j++)
                    System.err.println(j+": "+sectionNodes.item(j).getLocalName());
                System.err.println("-----");
            catch (SAXException se)
                System.err.println("SAX EXCEPTION");
                se.printStackTrace();
            catch (IOException ioe)
                System.err.println("IO EXCEPTION");
                ioe.printStackTrace();
        public static void main(String[] args)
            ConfigParams cp = new ConfigParams();
    }The program outputs the following:
    0: ToolConfig
    0: null
    1: database_info
    2: null
    3: spelling_info
    4: null
    5: server_info
    6: null
    7: concept_list
    8: null
    -----My question is: Why does it find nine child nodes when I only have four child nodes in the XML file? Why is every other child node null?
    Thanks,
    Jon

    Thanks. That was helpful. I changed the getLocalName() call to getNodeName() and now it makes more sense. I do have another question, though: what is a local node name? What is a qualified node name?
    Thanks,
    Jon
    P.S. Or maybe I should just go Read The Fine Manual.

  • XML question on textnode null value

    Hi,
    I don't known XML use, I'm learning.
    My question is
    If in the DomDocument newsXML I append to "node" the newelement and a textnode, initially with not null value. Why, then, can't I setNodeValue to Null?
    newelement:=xmldom.createelement(newsXML,element_name);
    newnode:=xmldom.appendchild(node,xmldom.MAKENODE(newelement));     
    Textitem:=xmldom.createTextNode(newsXML,value);
    newnode:=xmldom.appendchild(newnode,xmldom.MAKENODE(Textitem));
    xmldom.setNodeValue(newnode,null); not possible!!!
    Why?
    Yet,
    is There another way to append a leaf null in the tree of xml?
    Thanks!

    I maybe wrong about this because my XML is a little rusty, but I thing a Node is null when we create it. It is only by adding a TextNode to it that we make it not null.
    If that's the wrong answer I will just suggest you visit one of the OTN XML forums which you can find here.
    Cheers, APC

Maybe you are looking for

  • System Utilities Check - Error while installs OraApps on AIX

    Hello Everyone , OS : AIX 5.3 TL12 Oracle Applications 11.5.10.2 while trying to install Oracle Applications on AIX everything passed the TEST / Checks except the following [System Utilities Check] << faild with the following error message System Uti

  • PDF files on a Touch???

    Hello, Can you view an electronic booklet, or other PDF file on a Touch with out using Safari? Is there an Adobe app? Cheers

  • MacBook Pro Software Update 1.0

    Each, who that found what's it did have to fixed? People saying that it runs cooler... (Before my MBP would get up to 68C while browsing the web without the fans going above 2K rpm. Now they kick in around 55C.

  • Dblink between different version of oracle databases

    Hi Oracle Database Gurus Is it possible to create a database link between 10.x and 11.x oracle database. Could somebody pinpoint a passage of oracle documentation connected with that topic. Regards Zibi

  • Ix2-dl problems after router upgrade.

    I originally installed the ix2-dl and had zero issues.  I had full access to everything through windows explorer.  I had a first gen apple airport router at the time.  Last week I upgraded to a 4th gen apple airport and when I did my ix2-dl moved to