Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


BTS 2002 Map XPATH Manipulation?

From: "Steve Yetter" <yetters@-------.--->
To: NULL
Date: 8/6/2004 11:00:00 AM
I work with HL7 files which have elements in excess of 300 for each
document. It is tedious to say the least to draw the lines for these since
most of them just map across to their counterpart in the destination
document.

We are working on a tool to automatically map elements that have the same
name, cardinality  and datatype. The tool is being written in C#.  We would
like to use the XPathDocument, XPathNavigator, and XPathNodeIterator classes
to hold and  process the documents.  We have run into problems when trying
to apply this expression, "*[//Schema]"  to the XML extract below. It
returns an empty node set:

<Schema name="ADT_A01" b:BizTalkServerEditorTool_Version="1.5"
b:root_reference="ADT-A01" b:standard="XML"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes">
    <b:SelectionFields />
    <ElementType name="MSH_1_FieldSeparator" content="textOnly"
model="closed" b:type="string">
      <description>Field Separator</description>
    </ElementType>
</Schema>

If we remove the namespaces and their references the expression returns a
node set when applied to this XML extract but I am confused as to what is
returned. The Name property of the XPathNodeIterator current object is
"Schema" and the Value property of this object is "Field
Separator" which is the contents of the description node.

<Schema name="ADT_A01" BizTalkServerEditorTool_Version="1.5"
root_reference="ADT-A01" standard="XML">
    <SelectionFields />
   <ElementType name="MSH_1_FieldSeparator" content="textOnly"
model="closed" type="string">
      <description>Field Separator</description>
    </ElementType>
  </Schema>


We obviously do not understand what we are doing so if anyone has some code
samples that show how to manipulate the map I would appreciate it!

The code we are using is:
  private void ultraButtonLoadMap_Click(object sender, System.EventArgs e)
  {
   if( openFileDialogMap.ShowDialog(this) == DialogResult.OK )
   {
    _segments.Clear();
    ultraLabelLoadMapPath.Text = openFileDialogMap.FileName;
    try
    {
     XPathDocument messageDoc = new
XPathDocument(openFileDialogMap.FileName);
     XPathNavigator nav = messageDoc.CreateNavigator();
     XPathNodeIterator Iterator = nav.Select( textBoxXPath.Text );
     while (Iterator.MoveNext())
     {
      if( Iterator.Current.Value.Trim().Length == 3 )
       _segments.Add(Iterator.Current.Value.Trim());
     }
     int i = 0;
     i++;
    }
    catch( Exception ex )
    {
     MessageBox.Show( ex.Message);
    }
   }
  }



Thanks!

--
The opinions stated above do not necessarily reflect those of St. Joseph's
Hospital,
The aforementioned institution takes no responsibility for the contents of
this message.




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent