Advertisement

12.07.2004 at 02:15PM PST, ID: 21234040
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Merge document.xml with master.xml using XSLT

Asked by cklanac in Extensible Markup Language (XML)

Tags: , ,

I need help merging two XML files (eg master.xml and document_XXX.xml). Essentially, we have a simgle "master.xml" file which contains all the possible nodes, but it evolves as clients want updates. We also have old XML files with data but they are missing nodes when compared to the master.xml. The nodes in the documents are always a subset of the master.xml

In the example, please note: The master.xml has /keywords/keyword/@type but doc#35 does not. The master has a relatedLinks node but document does not. And the master.xml has one "dummy" page node but doc#35 has 2 actual pages.

So you can think of the problem in two ways. Either you populate the master.xml with the data from the document, repeating nodes as necessary. Or given document #35, we need to append all the missing nodes and attributes.

BTW, I've been working on this problem for several days... I don't know if that means it's difficult or I'm just an idiot (or both) but I've certainly tried before asking the experts.

========== Document master template ===========
<document id="" status="">
      <title><![CDATA[]]></title>
      <date></date>
      <authors>
         <author id="">
            <firstName></firstName>
            <lastName></lastName>
         </author>
      </authors>
      <keywords>
         <keyword id="" type=""></keyword>
      </keywords>
   <content>
      <page>
            <subTitle><![CDATA[]]></subTitle>
            <subBody><![CDATA[]]></subBody>
            <subFooter><![CDATA[]]></subFooter>
         </page>
   </content>
   <relatedLinks>
      <link>
         <text></text>
         <url></url>
      <link>
   </relatedLinks>
</document>

========== Document #35===========
<document id="35" status="1">
      <title><![CDATA[Title of the document.]]></title>
      <date>12/31/2004 5:00PM</date>
      <authors>
         <author id="5">
            <firstName>John</firstName>
            <lastName>Doe</lastName>
         </author>
      </authors>
      <keywords>
         <keyword id="3">Blue</keyword>
         <keyword id="5">Green</keyword>
         <keyword id="7">Red</keyword>
      </keywords>
   <content>
      <page>
            <subTitle><![CDATA[Title of page #1]]></subTitle>
            <subBody><![CDATA[Body of page #1]]></subBody>
            <subFooter><![CDATA[Footer of page #1]]></subFooter>
         </page>
         <page>
            <subTitle><![CDATA[Title of page #2]]></subTitle>
            <subBody><![CDATA[Body of page #2]]></subBody>
            <subFooter><![CDATA[Footer of page #2]]></subFooter>
         </page>
   </content>
</document>

========== Merged Document Output ===========
<document id="35" status="1">
      <title><![CDATA[Title of the document.]]></title>
      <date>12/31/2004 5:00PM</date>
      <authors>
         <author id="5">
            <firstName>John</firstName>
            <lastName>Doe</lastName>
         </author>
      </authors>
      <keywords>
         <keyword id="3" type="">Blue</keyword>
         <keyword id="5" type="">Green</keyword>
         <keyword id="7" type="">Red</keyword>
      </keywords>
   <content>
      <page>
            <subTitle><![CDATA[Title of page #1]]></subTitle>
            <subBody><![CDATA[Body of page #1]]></subBody>
            <subFooter><![CDATA[Footer of page #1]]></subFooter>
         </page>
         <page>
            <subTitle><![CDATA[Title of page #2]]></subTitle>
            <subBody><![CDATA[Body of page #2]]></subBody>
            <subFooter><![CDATA[Footer of page #2]]></subFooter>
         </page>
   </content>
   <relatedLinks>
      <link>
         <text></text>
         <url></url>
      <link>
   </relatedLinks>
</document>

Start Free Trial
[+][-]12.07.2004 at 04:14PM PST, ID: 12769587

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.07.2004 at 04:25PM PST, ID: 12769640

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.07.2004 at 04:31PM PST, ID: 12769665

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.07.2004 at 05:23PM PST, ID: 12769912

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Extensible Markup Language (XML)
Tags: merge, xslt, xml
Sign Up Now!
Solution Provided By: jkmyoung
Participating Experts: 2
Solution Grade: A
 
 
[+][-]12.07.2004 at 05:27PM PST, ID: 12769926

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.07.2004 at 05:29PM PST, ID: 12769933

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.07.2004 at 07:45PM PST, ID: 12770478

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32