Merging two XML Document Objects

I'm trying to merge two seperate XML Document Objects into one Object.
Any suggestions would be very much appreciated.
This is what the Objects look like when returned.
FIRST:
<?xml version = '1.0'?>
<app>
<name>Home</name>
<active>true</active>
<order-as-sibling>1</order-as-sibling>
</app>
SECOND:
<app>
<name>Developers</name>
<active>true</active>
<order-as-sibling>6</order-as-sibling>
</app>

That would work nicely if the XML documents had names, but they are coming back as a list in an XML object. I have about 8 separate XML Objects I'd like to merge into one.
Thanks

Similar Messages

  • How to merge two XML's with JDOM?

    How to merge two xmls's using jdom? like:
    is there a way to add the complete content one xml into the parent node of another xml?
    //in.xml
    <?xml version="1.0"?>
    <people>
    <person>
      <name>ABC</name>
      <email>[email protected]</email>
    </person>
    </people>
    //out.xml
    <?xml version="1.0"?>
    <address>
    <city> abccounty</city>
    <state> abcstate</state>
    </address>
    Merged XML:
    <?xml version="1.0"?>
    <people>
    <person>
      <name>xyz</name>
      <email>[email protected]</email>
    </person>
    <address>
    <city> abccounty</city>
    <state> abcstate</state>
    </address>
    </people>
    import java.util.List;
    import org.jdom.Document;
    import org.jdom.Element;
    import org.jdom.input.SAXBuilder;
    import org.jdom.output.Format;
    import org.jdom.output.XMLOutputter;
    public class MergeXMLS {
         public static void main(String[] args) {
              try{
                  SAXBuilder builder = new SAXBuilder();
                  Document books = builder.build("D:/in.xml");
                  Document onebook = builder.build("D:/out.xml");
                  Element root = books.getRootElement();
                  List rows = root.getChildren();
                  for (int i = 0; i < rows.size(); i++) {
                      Element row = (Element) rows.get(i);
                      onebook.getRootElement().addContent(row.detach());
                      System.out.println(row.getName());
                  new XMLOutputter(Format.getPrettyFormat()).output(onebook, System.out);
              }catch(Exception e){
                   e.printStackTrace();
    }

    The above code only add's the first node.
    I changed the code little differently to
                  SAXBuilder builder = new SAXBuilder();
                  Document books = builder.build("D:/in.xml");
                  Document onebook = builder.build("D:/out.xml");
                 //trying to add second xml into the first
                  books.getRootElement().addContent(onebook.getRootElement().getContent()); 
                  new XMLOutputter(Format.getPrettyFormat()).output(books, System.out);
    here is the exception from the above code:
    org.jdom.IllegalAddException: The Content already has an existing parent "address"
         at org.jdom.ContentList.add(ContentList.java:218)
         at org.jdom.ContentList.add(ContentList.java:140)

  • Merging two xmls

    Hi,
    Just for information..
    How to merge two xmls
    1. convert the xml documents to xml variables using setValue activity. Only equating will convert xmlDoc to xml Variable.
    2. serialize() each xml input variable. Each variable will get converted to string
    3. concatenate both serialized variable and assing it to xml output variable. deserialization is not require. after concatenationg add root nodes if require.
    Regards
    Sunil

    Thanks for the reply!
    Can you please tell me in steps how can i achieve this using JAXP and DOM
    In steps in the sense : first convert xml's to something then do something.
    Thanks in advance.

  • How to Merge two PDF documents orginally created in different programs?

    I am trying to find information on how you can merge a PDF document created in LiveCycle and a PDF created in PageMaker or Microsoft Word?
    I know that you can easily merge two PDF documents created in the same program, but I am specifically looking for how you can merge two PDF documents created from two different programs. A step by step process would be helpful, if you have that information. Thanks.

    You use Assembler for this purpose.
    1) Assembler can be accessed through LC Java API. See http://help.adobe.com/en_US/enterpriseplatform/10.0/programLC/help/index.html
    API Quick Starts (Code Examples) > Assembler Service API Quick Starts
    2) Last week I posted on generating and merging PDF's from PostScript. Take a look at the assembly service instance in the .lca. Assembler uses DDX (Document Description XML) to describe document construction. NOTE the .lca was developed with ES 3 (aka ADEP). The .lca It contains the most basic DDX.
    <?xml version="1.0" encoding="UTF-8"?>
    <DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <PDF result="out.pdf">
      <PDF source="inDoc1"/>
      <PDF source="inDoc2"/>
    </PDF>
    </DDX>
    http://forums.adobe.com/message/4019760#4019760
    DDX Reference at http://help.adobe.com/en_US/livecycle/9.0/ddxRef.pdf
    Steve

  • How to compare the contents of two XML documents

    Hi all,
    I was trying to compare the contents of two xml documents, they are both validate for the same XML Schema. i was using the xmlunit to do this. but some how it doesn't work like what i have expected. for example:
    1.xml : <test><item>2</item><item>1</item></test>
    2.xml: <test><item>3</item><item>2</item><item>1</item></test>
    the result from XMLUnit is this two xmls are different, but it compares <item>2</item> with <item>3</item>, which i cannot find out where the real diiffs are.
    does anybody know how i can do this correct?
    best regards,
    tina

    I faced a similar problem in one of my projects and hence wrote my own comparator. Most comparators like ExamXML etc show XML as different if the nodes under a parent node occur in different seqeunce or a set of repeated nodes occur in different sequence. The comparator that I wrote gives you the flexibility to configure how to identify a node from a set of repeated nodes and is able to compare them successfully if they occur in any order. You can view the sample output at http://geocities.com/dheerendra_itbhu/TipsFromDheeru.html
    and contact me in case you need the source code.

  • XML Document object access problem?

    Hi,
    I have created a servlet,which will call .sh file, which will call java application.........
    this java application is working as a search engine,which will do search in the XML document object...........This is working fine when only one user run this servlet...........But when more than servlet do the same it is not working......... But once first servlet create the Document object,which is main source for serching..........then second servlet will work fine.......same thing with third servlet and so on...... I used the thread.sleep()/synchronize but it is not working...bcoz i am accessing the same application.....Then instead of servlet i tried to run the java application from the Dos prompt..........But i am facing the same problem......So pl guide me bcoz everything is working excluding this..........Becoz this document object creation is taking some time........ i am creating the object shown below
    Document doc =parseXmlFile("Article.xml", false);
    Element docElem = doc.getDocumentElement();
    public static org.w3c.dom.Document parseXmlFile(String filename, boolean validating)
                   try {
         // Create a builder factory
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setValidating(validating);
         // Create the builder and parse the file
         // org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(filename);
         org.w3c.dom.Document doc = factory.newDocumentBuilder().parse(new File(filename));
         return doc;
    } catch (SAXException e) {
    // A parsing error occurred; the xml input is not valid
    } catch (ParserConfigurationException e) {
    } catch (IOException e) {
    return null;
    }

    Hi,
    This is my Servlet code..............
    package PW.Feed;
    import java.io.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.StreamResult;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.util.*;
    public class PrintDom extends HttpServlet
         Document doc;
         Element docElem;
         Connection Conn=null;
         Statement stmt=null,stmt1=null;
         ResultSet rs1=null,rs=null;
         PrintWriter out;
         Vector myVector1=new Vector();
         Vector myVector2=new Vector();
         String strSql="";
         public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
              res.setContentType("text/html");
              out=res.getWriter();
              try
                   String pubtype=req.getParameter("PubType");
                   String pubDate=req.getParameter("PubDate");
                   String toDate=req.getParameter("ToDate");
                   String fromDate=req.getParameter("FromDate");
                   if(pubDate==null)pubDate="2";
                   if(toDate==null)toDate="02/09/2005";
                   if(fromDate==null)fromDate="02/08/2005";
                   Class.forName("org.firebirdsql.jdbc.FBDriver");
                   Conn = DriverManager.getConnection("jdbc:firebirdsql:192.168.0.15/3050:D:/FBDatabases/PW1.GDB","SYSDBA","cohezia");
                   //Conn = DriverManager.getConnection("jdbc:firebirdsql:192.168.0.99/3050:/share/pw1.gdb","SYSDBA","cohezia");
                   stmt = Conn.createStatement( );
                   if(pubDate.equals("2"))
                        strSql="Select sh.ARTICLEID,sh.cuttingsdate,sh.READDATE,sh.headline,sh.SUMMARY,sh.AUTHOR,sh.PAGEFROM,sh.PUB_NAME,sh.READER_NAME,sh.PARENTTITLE,sh.CANMAIL,sh.PUBLICATION_ID,sh.JOURNALIST_ID,sh.ISPDF FROM SCANSHEADER sh,PUBLICATIONS p where sh.publication_id=p.publication_id and sh.readdate>'"+fromDate+"' and sh.readdate<'"+toDate+"' and p.pubtype='"+ pubtype +"' order by sh.ARTICLEID";
                   else
                        strSql="Select sh.ARTICLEID,sh.cuttingsdate,sh.READDATE,sh.headline,sh.SUMMARY,sh.AUTHOR,sh.PAGEFROM,sh.PUB_NAME,sh.READER_NAME,sh.PARENTTITLE,sh.CANMAIL,sh.PUBLICATION_ID,sh.JOURNALIST_ID,sh.ISPDF FROM SCANSHEADER sh,PUBLICATIONS p where sh.publication_id=p.publication_id and sh.cuttingsdate>'"+fromDate+"' and sh.cuttingsdate<'"+toDate+"' and p.pubtype='"+ pubtype +"' order by sh.ARTICLEID";
                   rs=stmt.executeQuery(strSql);
                   DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
                   doc = builder.newDocument();
                   docElem = doc.createElement("RECORDLIST");
                   doc.appendChild(docElem);
                   Element rootElem = doc.createElement("RECORDS");
                   docElem.appendChild(rootElem);
                   String artid="";
                   while(rs.next())
                             Element artElem = doc.createElement("RECORD");
                             if((rs.getString("ARTICLEID")).length()>0)artElem.setAttribute("id",rs.getString("ARTICLEID"));
                             rootElem.appendChild(artElem);
                             Element rootFieldElem = doc.createElement("FIELDS");
                             artElem.appendChild(rootFieldElem);
                             Element eleCuttingDate = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleCuttingDate);
                             eleCuttingDate.setAttribute("fieldName","CUTTINGSDATE");
                             if((rs.getString("CUTTINGSDATE")).length()>0) eleCuttingDate.appendChild(doc.createTextNode(rs.getString("CUTTINGSDATE")));
                             Element eleReadDate = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleReadDate);
                             eleReadDate.setAttribute("fieldName","READDATE");
                             if((rs.getString("READDATE")).length()>0) eleReadDate.appendChild(doc.createTextNode(rs.getString("READDATE")));
                             Element eleHeadLine = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleHeadLine);
                             eleHeadLine.setAttribute("fieldName","HEADLINE");
                             if((rs.getString("HEADLINE")).length()>0) eleHeadLine.appendChild(doc.createTextNode(rs.getString("HEADLINE")));
                             Element eleSummary = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleSummary);
                             eleSummary.setAttribute("fieldName","SUMMARY");
                             if(rs.getString("SUMMARY")==null){
                                  //out.println("String is null");
                                  else
                                  {eleSummary.appendChild(doc.createTextNode(rs.getString("SUMMARY")));}
                             Element eleAuthor = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleAuthor);
                             eleAuthor.setAttribute("fieldName","AUTHOR");
                             if((rs.getString("AUTHOR")).length()>0) eleAuthor.appendChild(doc.createTextNode(rs.getString("AUTHOR")));
                             Element elePageFrom = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePageFrom);
                             elePageFrom.setAttribute("fieldName","PAGEFROM");
                             if((rs.getString("PAGEFROM")).length()>0) elePageFrom.appendChild(doc.createTextNode(rs.getString("PAGEFROM")));
                             Element elePubName = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePubName);
                             elePubName.setAttribute("fieldName","PUBNAME");
                             if((rs.getString("PUB_NAME")).length()>0) elePubName.appendChild(doc.createTextNode(rs.getString("PUB_NAME")));
                             Element eleReaderName = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleReaderName);
                             eleReaderName.setAttribute("fieldName","READER NAME");
                             if((rs.getString("READER_NAME")).length()>0) eleReaderName.appendChild(doc.createTextNode(rs.getString("READER_NAME")));
                             Element eleParentTitle = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleParentTitle);
                             eleParentTitle.setAttribute("fieldName","PARENTTITLE");
                             if((rs.getString("PARENTTITLE")).length()>0)eleParentTitle.appendChild(doc.createTextNode(rs.getString("PARENTTITLE")));
                             Element eleCanMail = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleCanMail);
                             eleCanMail.setAttribute("fieldName","CANMAIL");
                             if((rs.getString("CANMAIL")).length()>0) eleCanMail.appendChild(doc.createTextNode(rs.getString("CANMAIL")));
                             Element elePublicationID = doc.createElement("FIELD");
                             rootFieldElem.appendChild(elePublicationID);
                             elePublicationID.setAttribute("fieldName","PUBLICATION_ID");
                             if((rs.getString("PUBLICATION_ID")).length()>0) elePublicationID.appendChild(doc.createTextNode(rs.getString("PUBLICATION_ID")));
                             Element eleJournlistID = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleJournlistID);
                             eleJournlistID.setAttribute("fieldName","JOURNALIST_ID");
                             if((rs.getString("JOURNALIST_ID")).length()>0) eleJournlistID.appendChild(doc.createTextNode(rs.getString("JOURNALIST_ID")));
                             Element eleIspdf = doc.createElement("FIELD");
                             rootFieldElem.appendChild(eleIspdf);
                             eleIspdf.setAttribute("fieldName","ISPDF");
                             if((rs.getString("ISPDF")).length()>0) eleIspdf.appendChild(doc.createTextNode(rs.getString("ISPDF")));
                             Element rootKeyElem=doc.createElement("KEYWORDS_CODES");
                        String[] arrCodes=getKeyCodes(rs.getString("ARTICLEID"));
                        int count1 = myVector1.size();
                        String[] myArray1=new String[count1];
                        myVector1.copyInto(myArray1);
                        int count2 = myVector2.size();
                        String[] myArray2=new String[count2];
                        myVector2.copyInto(myArray2);
                        for(int j=0;j<arrCodes.length;j++)
                             Element eleKeyword= doc.createElement("KEYWORD_CODE");
                             eleKeyword.setAttribute("CodeId",arrCodes[j]);
                             eleKeyword.setAttribute("LongName",myArray1[j]);
                             eleKeyword.setAttribute("CodeType",myArray2[j]);
                             rootKeyElem.appendChild(eleKeyword);
                        artElem.appendChild(rootKeyElem);
                   Source source = new DOMSource(docElem);
                   //File file = new File("/share/PrintDom.xml");
                   StringWriter rw=new StringWriter();
                   Result result = new StreamResult(rw);
                   //Result result = new DOMResult();
                   // Write the DOM document to the file
                   Transformer xformer = TransformerFactory.newInstance().newTransformer();
                   xformer.transform(source, result);
                   out.println(rw);
              catch (ClassNotFoundException e)
                        out.println("Unable to load Driver Class" + e);
                        return;
                        //fileLog.log(e,"PressWatchFrame1.PressWatchFrame1()");
              catch (SQLException se)
                   out.println(se);
              catch (Exception e)
                   out.println(e);
    finally{
                        try{
                             if(Conn!=null) Conn.close();
                        catch(SQLException ignored){}
         public String[] getKeyCodes(String strArticleId)
              Vector myVector=new Vector();
              myVector1.removeAllElements();
              myVector2.removeAllElements();
         try{
              stmt1=Conn.createStatement( );
              //String strSql1="Select codeid FROM SCANSSUBJECT where articleid='"+ strArticleId +"'";
              String strSql1="Select ss.codeid,c.longname,c.codetype FROM SCANSSUBJECT ss,CODES c where ss.codeid=c.codeid and articleid='"+ strArticleId +"'";
              rs1=stmt1.executeQuery(strSql1);
              String strCodes="";
              while(rs1.next())
                   myVector.add(rs1.getString("codeid"));
                   myVector1.add(rs1.getString("longname"));
                   myVector2.add(rs1.getString("codetype"));
              }catch (SQLException se)
                                       out.println(se);
              int count = myVector.size();
              String[] myArray = new String[count];
              myVector.copyInto(myArray);
              return myArray;
    ..................Thanx

  • Converting string to xml Document object.

    Hi all,
    I having a string consiste of xml data.
    I wants to convert this to an xml document object.
    When i am trying to do this i am getting fatal error Premature End of file.
    This is sample code from my program.
    String xmlStr = " <TravelItineraryAddInfoRQ>
    <POS>
    <Source PseudoCityCode="A2PB"/>
    </POS>
    </TravelItineraryAddInfoRQ>";
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware( false );
              DocumentBuilder builder = null;
              char[] ch = new char[1200];
    builder = factory.newDocumentBuilder();
    StringReader sr = new StringReader(xmlStr);
    InputSource is = new InputSource(sr);
    Reader r = is.getCharacterStream();
    r.read(ch);
    System.out.println("String Starting ==== ");
    for(int i=0;i<ch.length;i++)
    System.out.print(ch);
    Document XMLDoc = builder.parse(new InputSource(sr));
    System.out.println("Document Object ==== "+XMLDoc);
    thnx,
    raj

    Hi Rajaven,
    use the below step, I think it could help u
    StringBufferInputStream sb = new StringBufferInputStream(strBf));
    doc = db.parse(sb);first conver a string to StringBufferInputStream then parse to doc Object
    hope it will solve.
    let me know if it's not working
    With cheers,
    PrasannA

  • How to merge two xmls.

    Hi All,
    I want to merge two xmls in my output. My scenario is I am getting two sets of outputs and I want to merge them to get my final output. I my output I have a header and a Lineitem. I my final output I want to keep header only once and all the LineItems one by one.Can anyone suggest something.
    First outout:-
    <outputVariable>
    -<part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    -<SiebelOrderQueryByExample_Output xmlns="http://siebel.com/asi/">
    -<ns:SiebelOrderQueryByExample_Output xmlns:ns="http://siebel.com/asi/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    -<ListOfOrderInterface xmlns="http://www.siebel.com/xml/Siebel%20Order">
    <Orders>
    <Id>1-15IXJ</Id>
    <OrderNumber>1012-1234</OrderNumber>
    <ListOfLineItems>
    <LineItems>
    <Id>1-15IY3</Id>
    <OrderNumber>1012-1234</OrderNumber>
    <LineNumber>301</LineNumber>
    </LineItems>
    </ListOfLineItems>
    </Orders>
    </ListOfOrderInterface>
    Second output:-
    <outputVariable>
    -<part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    -<SiebelOrderQueryByExample_Output xmlns="http://siebel.com/asi/">
    -<ns:SiebelOrderQueryByExample_Output xmlns:ns="http://siebel.com/asi/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    -<ListOfOrderInterface xmlns="http://www.siebel.com/xml/Siebel%20Order">
    -<Orders>
    <Id>1-15IXJ</Id>
    <OrderNumber>1012-1234</OrderNumber>
    <ListOfLineItems>
    <LineItems>
    <Id>1-15IW2</Id>
    <OrderNumber>1012-1234</OrderNumber>
    <LineNumber>302</LineNumber>
    </LineItems>
    </ListOfLineItems>
    </Orders>
    </ListOfOrderInterface>
    The required output which I want after merging.
    <outputVariable>
    -<part name="payload" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    -<SiebelOrderQueryByExample_Output xmlns="http://siebel.com/asi/">
    -<ns:SiebelOrderQueryByExample_Output xmlns:ns="http://siebel.com/asi/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    -<ListOfOrderInterface xmlns="http://www.siebel.com/xml/Siebel%20Order">
    -<Orders>
    <Id>1-15IXJ</Id>
    <OrderNumber>1012-1234</OrderNumber>
    <ListOfLineItems>
    <LineItems>
    <Id>1-15IW2</Id>
    <OrderNumber>1012-1234</OrderNumber>
    <LineNumber>302</LineNumber>
    </LineItems>
    <LineItems>
    <Id>1-15IY3</Id>
    <OrderNumber>1012-1234</OrderNumber>
    <LineNumber>301</LineNumber>
    </LineItems>
    </ListOfLineItems>
    </Orders>
    </ListOfOrderInterface>
    Thanks

    I am not using file adapter. I am taking inputs from the BPEL client and displaying output to the client. My input xsd is:-
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://www.example.org/ns/intorder"
    targetNamespace="http://www.example.org/ns/intorder"
    elementFormDefault="qualified">
    <xsd:element name="order" type="orderType">
    <xsd:annotation>
    <xsd:documentation>
    A sample element
    </xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:complexType name="orderType">
    <xsd:sequence>
    <xsd:element name="Order_Number" type="xsd:string"/>
    <xsd:element name="Line_item" type="LineType" maxOccurs="unbounded" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="LineType">
    <xsd:sequence>
    <xsd:element name="Line_Number" type="xsd:string" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>

  • Merge two word documents

    Hi All,
    I have a requirement to merge two word documents into one word document. I will upload both the documents from presentation server and have to merge both the documents into 1 word document and save in in SAP.
    Is it possible to merge two word documents?
    Thanks,
    Amit

    Same requirement i posted earlier
    check this

  • Merge two XML files From java

    hi,
    i'm in need to merge two XML files from my java code please help me as soon......

    Rajesh42 wrote:
    hi,
    i'm in need to merge two XML files from my java code please help me as soon......Hello Rajesh42,
    While it is wonderful that you have discovered the magically code tags, please consider if it is the right time to use them. Code tags should only go round code. Note used to make your posts "stand out", or used to quote other people. Just code.
    As to your question, what have you tried, what are you stuck on?
    Mike

  • Possible to combine two xml documents into a single query?

    In ASP, PHP, etc. if I wanted to combine two tables and
    filter by one =
    item, I would create a recordset combining the two on one
    common element =
    and have one recordset. Is that possible with xml documents
    and Spry =
    datasets?
    I have xml information sent to me 4 times a day from a
    weather service. =
    This happens automatically, but the two xml documents
    (current.xml and =
    forecast.xml) are set in stone by the service. However, if in
    my Spry =
    dataset, I could combine them so I could list the 15 cities
    in a master =
    region and have tabs for the current conditions and forecast
    which would =
    each access a separate xml document but needs to do that from
    the city =
    link on the left, that would work great.
    Can I do this as I would be able to if I had a database with
    different =
    tables?
    Thanks!
    Nancy

    Hi Kin:
    They are really static xml files that are placed in a folder
    directly by =
    the weather service. The files in question are current.xml
    and =
    forecast.xml.
    And there is not one per city .. but just one of each. the
    location =
    node in current.xml and the citycode node in forecast.xml
    contain the =
    same information.
    If I were doing this in a recordset with a database, I would
    write =
    something like SELECT whatever from current, forecast WHERE =
    current.location =3D forecast.citycode AND current.location
    =3D variable =
    (which would be what is clicked on).
    This sets up a master/detail arrangement for the first one
    that works =
    fine. Click on the city code (which I have to write something
    to say If =
    location =3D FAT, document.write "Fresno" and so on) and the
    rest of the =
    current information displays fine on the right side of the
    page. Now I =
    have to marry that to the forecast.xml file so that when
    citycode =3D =
    FAT, the five day information for Fresno shows up .. and so
    on. I was =
    planning to use Spry tabs or whatever to show the data.
    <!--
    var dsCurrent =3D new Spry.Data.XMLDataSet("current.xml", =
    "weather/current");
    //-->
    </script>
    </head>
    <body>=20
    <div class=3D"MasterDetail">
    <div spry:region=3D"dsCurrent"
    class=3D"MasterContainer">
    <div class=3D"MasterColumn" spry:repeat=3D"dsCurrent" =
    spry:setrow=3D"dsCurrent" spry:hover=3D"MasterColumnHover" =
    spry:select=3D"MasterColumnSelected">{location}</div>
    </div>
    <div spry:detailregion=3D"dsCurrent"
    class=3D"DetailContainer">
    <div class=3D"DetailColumn">{phrase}</div>
    <div class=3D"DetailColumn">{temp}</div>
    <div class=3D"DetailColumn">{temp/@units}</div>
    <div class=3D"DetailColumn">{aptemp}</div>
    <div class=3D"DetailColumn">{aptemp/@unit}</div>
    <div class=3D"DetailColumn">{wndchl}</div>
    <div class=3D"DetailColumn">{wndchl/@unit}</div>
    <div class=3D"DetailColumn">{rhumid}</div>
    <div class=3D"DetailColumn">{rhumid/@unit}</div>
    <div class=3D"DetailColumn">{wind_dir}</div>
    <div class=3D"DetailColumn">{windspeed}</div>
    <div
    class=3D"DetailColumn">{windspeed/@unit}</div>
    <div class=3D"DetailColumn">{pres}</div>
    <div class=3D"DetailColumn">{pres/@unit}</div>
    <div class=3D"DetailColumn">{vis}</div>
    <div class=3D"DetailColumn">{vis/@unit}</div>
    <div class=3D"DetailColumn">{icon}</div>
    </div>
    Arnout gave me some suggestions .. but so far, I haven't
    gotten either =
    of them to work. Also I am trying to get some ideas from spry
    Samples =
    from the Spry home page/samples area, but again .. not yet.
    Thanks,
    Nancy
    "kinblas" <[email protected]> wrote in
    message =
    news:[email protected]...
    >I don't think you need to combine them just so they can
    render in a =
    tabbed=20
    > widget. We're still missing a couple of key pieces of
    information. =
    What does=20
    > the data that is used in the master region look like?
    Are what you =
    refer to as=20
    > current.xml and forecast.xml really static files? Or are
    they =
    dynamically=20
    > generated by a server side script (php/cf/etc)? There is
    one current =
    and=20
    > forecast xml per city right?
    >=20
    > I ask these questions because you may be able to simply
    set up a =
    master detail=20
    > relationship between 3 data sets and just use those
    within a region(s) =
    that=20
    > build up the tab widget. Assuming you were getting the
    list of cities =
    from a=20
    > 3rd source, you could set up something like this:
    >=20
    >=20
    > var dsCities =3D new Spry.Data.XMLDataSet("cities.xml",
    =
    "/cities/city");
    > var dsCurrent =3D new=20
    >
    Spry.Data.XMLDataSet("current.php?location=3D{dsCities::name}",=20
    > "/weather/current");
    > var dsForecast =3D new=20
    >
    Spry.Data.XMLDataSet("forecast.php?citycode=3D{dsCities::name}",=20
    > "/weather/forecast/day");
    >=20
    >=20
    > ...
    >=20
    >=20
    > <div id=3D"TabbedPanels1" class=3D"TabbedPanels">
    > <ul class=3D"TabbedPanelsTabGroup">
    >
    Current</li>
    >
    Forecast</li>
    >
    > <div class=3D"TabbedPanelsContentGroup">
    > <div class=3D"TabbedPanelsContent"
    spry:region=3D"dsCurrent">
    > {temp}{temp/@unit}
    > </div>
    > <div class=3D"TabbedPanelsContent"
    spry:region=3D"dsForecast">
    >
    > <li spry:repeat=3D"dsForecast">{name}<br
    />High: =
    {high}{high/@unit}<br=20
    > />Low: {low}{low/@unit}</li>
    >
    > </div>
    > </div>
    > </div>
    >=20
    >=20
    >=20
    > --=3D=3D Kin =3D=3D--
    >

  • How to merge two movies documents into 1 in  iTunes?

    Can anyone tell me how to merge two movies documents into one in iTunes? Sorry maybe this is an easy and dumb question for you, but I have totally no idea. I download some movies in Windows and use Kigo Video Coverter to converte them into mp4 format. So I can watch it through new Apple TV in my big screen TV. Now I am thinking maybe I can upgrade my experience a bit more. Because some movies are downloaded into 2 or 3 separated document and I have to choose and click them while seeing. Is there any software can merge those separated documents into one single in mp4 format? I wish you could give me several to choose . Freeware is better. Thanks in advance.

    Thanks. I've tried simplemovies application but it seems too much complicated for me. I read some passages online and bought Quicktime Pro ($30) and finally link 2 mp4 documents together. So easy. Only issue is I have to pay $ 30 .

  • Difference between two xml documents

    Hi,
    I have two xml documents docA and docB that loos like this,
    <root>
    <a>
        <b>...</b>
        <c>...</c>
        <d>...</d>
    </a>
    <a>
    </a>
    </root>I want to compare them and get a new xml document that consists of every <a> thats only in docB (I know that the only two cases is that a given <a> is either in both or only in docB) is there any library that can help me with this? I've looked at xmlunit but I could only get it to either just return true/false or give a complete list of differences.
    /Andreas

    You have not really specified precisely what you want to compare on. XQuery 1.0 and XPath 2.0 have a function deep-equal that might be able to do what you want so an XQuery like
    <root>{
      doc('docB.xml')/root/a[not(some $a in doc('docA.xml')/root/a satisfies deep-equal(., $a))]
    </root>could give you the result you want, depending on whether the [specification of deep-equal|http://www.w3.org/TR/xpath-functions/#func-deep-equal] matches your expectation.
    As the SUN Java JRE has no XQuery support you need a third party library such as [Saxon 9|http://saxon.sourceforge.net/] .

  • Merge two XML

    10g
    xml1 = "
    <item>
    <name>Book</name>
    <price>12</price>
    <detail></detail>
    </item>"
    xml2 = "
    <title>kids book</title>
    <year>2007</year>"
    I'm using a "DBMS_XMLDOM" to merge two XML to one.
    Would you please help me?
    result:
    <item>
    <name>Book</name>
    <price>12</price>
    <detail>
    <title>kids book</title>
    <year>2007</year>
    </detail>
    </item>

    Or maybe this?:
    SQL> SELECT xml1,
           xml2,
           XMLTYPE (REPLACE (xml1, '</item>') || xml2 || '</item>') merged_xml
      FROM (SELECT '<item>
    <name>Book</name>
    <price>12</price>
    <detail></detail>
    </item>' xml1,
                   '<title>kids book</title> <year>2007</year>' xml2
              FROM DUAL)
    XML1                      XML2                      MERGED_XML                                       
    <item>                    <title>kids book</title>  <item>                                           
    <name>Book</name>         <year>2007</year>         <name>Book</name>                                
    <price>12</price>                                   <price>12</price>                                
    <detail></detail>                                   <detail></detail>                                
    </item>                                             <title>kids book</title>
                                                        <year>2007</year>
                                                        </item>
    1 row selected.

  • Build the delta from two xml documents

    Hi,
    i look for a solution to solve the following problem:
    i want to build a xml-based interface to pass my data to a client(Web etc.) and i dont know in which way the client manipulates the data and what in the xml-document was changed, inserted or deleted.
    What i have is the original-document and the changed-document (both based on the same DTD). How can i determine the delta from the two documents, cause i must know what actions to be taken (for example put <?bc4j remove?> or an appropriate tag for the XDK in the xml)
    any suggestion ???
    TIA
    Oliver

    The Oracle XDK for Java comes with a utility called XMLDiffer that, given XML Documents A and B, produces an XSLT stylesheet S that transforms A to B.
    Might be of use to you. That's the only inhouse XML diffing technology that I'm aware of. We use it internally in JDeveloper for merging machine-generate web.xml file edits with the user's hand-written web.xml file edits.

Maybe you are looking for