473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

XPath Editor (Updated!)

Hi All,

I have updated my XPath Generator software: XPath Studio .NET.

( http://www.ziggyware.com/downloads.php?cat_id=2 )

Easily select nodes from an xml file to generate XPath statements

Insert node values to narrow down XPath results

Insert by node value ornode existance

Multi-threaded framework to prevent stalls in the application when
working with large XML data files

Quick and easy to use interface is easy to use for novices

Resulting XPath query conforms to XPath 1.0 standards

View the Help Article for information relating to XPath Studio .NET
( http://www.ziggyware.com/articles.php?cat_id=1 )

Questions? Ask them on the XPath Studio .NET Forums
( http://www.ziggyware.com/forum/viewforum.php?forum_id=3 )

Thanks,
Michael "Ziggy" Morton

http://www.ziggyware.com

Aug 24 '06 #1
3 3233
Nice tool!

I am looking for something that will do the reverse. I have a whole bunch
of XPath statements and I need to use them to generate and populate an XML
document. I have maping file that maps my data to a specific XPath. For
example:

Field# XPath
1 /LOAN/_APPLICATION/ASSET/@_Type
2
/LOAN/_APPLICATION/RESPA_FEE/_PAYMENT/@_IncludedInAPRIndicator

etc.

Do I have to parse every line myself or is there a .NET class that will do
this for me?
Aug 29 '06 #2
"Yossi" <jo**********@firstfi.comwrote in message
news:u2**************@TK2MSFTNGP04.phx.gbl...
Nice tool!

I am looking for something that will do the reverse. I have a whole bunch
of XPath statements and I need to use them to generate and populate an XML
document. I have maping file that maps my data to a specific XPath. For
example:

Field# XPath
1 /LOAN/_APPLICATION/ASSET/@_Type
2 /LOAN/_APPLICATION/RESPA_FEE/_PAYMENT/@_IncludedInAPRIndicator

etc.

Do I have to parse every line myself or is there a .NET class that will do
this for me?
I think you're on your own.

I've never heard of a requirement like this. Instead of working against the
XPath, could you work from a schema?

Note that XPath, in general, is ambiguous. I hope that the XPath you're
being provided is restricted in helpful ways, like, no "//" or other
wildcards, no "..", no functions, etc. XPath isn't really good for
describing the structure of an XML document.

John
Aug 29 '06 #3

I though so....

I was hoping to find a function such as CreateAttribute(string XPath, string
data). For example:

CreateAttribute("/LOAN/_APPLICATION/ASSET/@_Type","Automobile") would create
the attribute and all needed parents if they don't exist:

<LOAN>
<_APPLICATION>
<ASSET _Type="Automobile">
</ASSET>
</_APPLICATION>
</LOAN>

If later on in the code I have this statement:
CreateAttribute("/LOAN/_APPLICATION/DOWN_PAYMENT/@_Type","CashOnHand"), it
will modify the above XML doc to:

<LOAN>
<_APPLICATION>
<ASSET _Type="Automobile">
</ASSET>
<DOWN_PAYMENT _Type="CashOnHand">
</DOWN_PAYMENT>
</_APPLICATION>
</LOAN>

In this following case, the function has to be smart enough to realize that
<ASSETalready has a _Type attribute, so it should create a new <ASSET>
element:
CreateAttribute("/LOAN/_APPLICATION/ASSET/@_Type","Automobile")

<LOAN>
<_APPLICATION>
<ASSET _Type="Automobile">
</ASSET>
<ASSET _Type="Automobile">
</ASSET>
<DOWN_PAYMENT _Type="CashOnHand">
</DOWN_PAYMENT>
</_APPLICATION>
</LOAN>

The tricky part now is to add nodes to an existing ASSET. I guess that
since both nodes look the same, we can add a node to either one:
CreateAttribute("/LOAN/_APPLICATION/ASSET/@_Type=\"Automobile\"/DESCRIPTION/@_Make","BMW")

<LOAN>
<_APPLICATION>
<ASSET _Type="Automobile">
<DESCRIPTION _Make="BMW">
</DESCRIPTION>
</ASSET>
<ASSET _Type="Automobile">
</ASSET>
<DOWN_PAYMENT _Type="CashOnHand">
</DOWN_PAYMENT>
</_APPLICATION>
</LOAN>

What abaout the year?
CreateAttribute("/LOAN/_APPLICATION/ASSET/@_Type=\"Automobile\"/DESCRIPTION/@_Make=\"BMW\"/@_Year","2006")

<LOAN>
<_APPLICATION>
<ASSET _Type="Automobile">
<DESCRIPTION _Make="BMW" _Year="2006">
</DESCRIPTION>
</ASSET>
<ASSET _Type="Automobile">
</ASSET>
<DOWN_PAYMENT _Type="CashOnHand">
</DOWN_PAYMENT>
</_APPLICATION>
</LOAN>

So I need to use String.Split() and walk the resulting array. I'll split at
'\'. I think I can use XPath to find an embeded node (i.e. ASSET inside
_APPLICATION inside LOAN). The thing is that I need to find the correct
ASSET node and the only thing that will differentiate them is what's on the
inside. Oh brother! This is going to be fun....

Any suggestions?
"John Saunders" <john.saunders at trizetto.comwrote in message
news:OM**************@TK2MSFTNGP04.phx.gbl...
"Yossi" <jo**********@firstfi.comwrote in message
news:u2**************@TK2MSFTNGP04.phx.gbl...
>Nice tool!

I am looking for something that will do the reverse. I have a whole
bunch of XPath statements and I need to use them to generate and populate
an XML document. I have maping file that maps my data to a specific
XPath. For example:

Field# XPath
1 /LOAN/_APPLICATION/ASSET/@_Type
2 /LOAN/_APPLICATION/RESPA_FEE/_PAYMENT/@_IncludedInAPRIndicator

etc.

Do I have to parse every line myself or is there a .NET class that will
do this for me?

I think you're on your own.

I've never heard of a requirement like this. Instead of working against
the XPath, could you work from a schema?

Note that XPath, in general, is ambiguous. I hope that the XPath you're
being provided is restricted in helpful ways, like, no "//" or other
wildcards, no "..", no functions, etc. XPath isn't really good for
describing the structure of an XML document.

John


Aug 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
6
by: Scott Simpson | last post by:
What is a good tool for running XPath queries on Linux? I have the O'Reilly XPath book and I'm using XPath Visualizer on Windows and that seems to work fine, but I'm looking for something on Linux....
2
by: ree32 | last post by:
When I import an xml document in Visual studio and Genereate as schema from it, and create a dataset from it, it adds this line into to the root element of my xml file -...
1
by: Robert Sander | last post by:
Hi, I have to do some case-insensitive queries on a XML document using XPath. Because XML 1.0 and XPath 1.0 are case-sensitive this is a little bit tricky. Sample document: <books>...
0
by: Olivier Ishacian | last post by:
XMLmind XML Editor V3.0 Patch 1 can be downloaded from http://www.xmlmind.com/xmleditor/download.shtml _____________________________________________ V3.0 Patch 1 (December 2, 2005) ...
4
by: Jethro | last post by:
I've tried to find the simplest demonstration of my issue. I have source XML that looks like this (not a real XSD schema, but it doesn't matter at this point): (in var xmlStr:) <xsd:element...
14
by: Mat| | last post by:
Hello :-) I am learning XPath, and I am trying to get child nodes of a node whose names do *not* match a given string, e.g : <dummy> <example> <title>Example 1</title> <body>this is an...
4
by: Claudio Calboni | last post by:
Hello folks, I'm having some performance issues with the client-side part of my application. Basically, it renders a huge HTML table (about 20'000 cells in my testing scenario), without content....
5
by: jorgedelgadolopez | last post by:
Hi all, I am using the xpathnavigator evaluate function on .net (xpath 1 right?). Now I need to expand the code to do multiple contains, compare dates (such as 'before', 'between' and 'after'),...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.