472,374 Members | 1,565 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 3176
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'),...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.