Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-13-2012, 10:30 AM   PM User | #1
charliecalthrop
New to the CF scene

 
Join Date: Sep 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
charliecalthrop is an unknown quantity at this point
use xsl to insert based on id

Hi, I wonder if you could help. I am a beginner! I have an xml file structured like this:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Zthes>
 <term>
    <termId>MESH002084</termId>
    <termUpdate>Add</termUpdate>
    <termName>Asthma</termName>
    <termType>Pt</termType>
   [...] a load more attributes 
    <relation>
      <relationType>NT</relationType>
      <termId>MANUAL000031</termId>
      <termName>Exercise-Induced Asthma</termName>
    </relation>
    <relation>
      <relationType>NT</relationType>
      <termId>MESH023026</termId>
      <termName>Status Asthmaticus</termName>
    </relation>
    <relation>
      <relationType>RT</relationType>
      <termId>MESH003628</termId>
      <termName>Bronchitis</termName>
    </relation>
  </term>
  <term>
    <termId>NESH002084</termId>
    <termUpdate>Add</termUpdate>
    <termName>Term 2</termName>
    <termType>Pt</termType>
   [...] a load more attributes 
    <relation>
      <relationType>NT</relationType>
      <termId>Not M</termId>
      <termName>term 3</termName>
    </relation>
  </term>
  </Zthes>
What I am trying to do is use xsl to to through, do a match on <term>
<termId>MESH002084</termId>


If it is not a MeSH Term, ignore it.

If it is a MeSH term, has <termType>Pt</termType>, and a <relation> tag exists (not all terms have relation), then what I would like to do is to copy any NT relations, so:
Code:
<relationType>NT</relationType>
      <termId>MESH023026</termId>
      <termName>Status Asthmaticus</termName>
    </relation>
And duplicate this but with a new <relationType>NT_mesh</relationType>:

Code:
<relationType>NT</relationType>
      <termId>MESH023026</termId>
      <termName>Status Asthmaticus</termName>
    </relation>
    <relationType>NT_mesh</relationType>
      <termId>MESH023026</termId>
      <termName>Status Asthmaticus</termName>
    </relation>
All I have got so far is hopeless, has anyone got any advice (aside from give up LOL)
charliecalthrop is offline   Reply With Quote
Reply

Bookmarks

Tags
multiple attribute select, xml, xsl

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:04 PM.


Advertisement
Log in to turn off these ads.