PeterInStingbert
asked on
XPATH Expression
Hi, i have a given XML (s. attached File)
it includes an Export of a Database-Schema
but the structure is "oversimplified"
Just nested Properties and Property Tags.
The Property-Tags named by Attribute PropertyName
Parent-Property further specified by Attribute MetaType (e.g. DbTable, DbColumn)
I Need different xpath queries to select nodes e.g.
all Property-Nodes with MetaType = "DbColumn" and with Primarykey=true and ColumnType=1
Thank you
Peter
test.xml
it includes an Export of a Database-Schema
but the structure is "oversimplified"
Just nested Properties and Property Tags.
The Property-Tags named by Attribute PropertyName
Parent-Property further specified by Attribute MetaType (e.g. DbTable, DbColumn)
I Need different xpath queries to select nodes e.g.
all Property-Nodes with MetaType = "DbColumn" and with Primarykey=true and ColumnType=1
Thank you
Peter
test.xml
ASKER
Sorry, my mistake ColumnTyp = 3 is correct.
ASKER
Thankl you
But in the result is only one record.
I Need all records, including the parent tag
e.g.
and in your manner
But in the result is only one record.
I Need all records, including the parent tag
e.g.
//Property[@MetaType='DbColumn'][normalize-space(Properties/Property[@PropertyName='AllowNull']) = 'false']
should give 3 recordsand in your manner
//Property[@MetaType='DbColumn'][normalize-space(Properties/Property[@PropertyName='IsPrimarykey']) = 'true'][normalize-space(Properties/Property[@PropertyName='AllowNull']) = 'false']
should give 2 records
"should"... it does not
so you need to be more precise on what you need
The XPath I sent does exactly what you asked for
So I assume the instructions were not precise enough
Tell me what exactly you need from the XML
so you need to be more precise on what you need
The XPath I sent does exactly what you asked for
So I assume the instructions were not precise enough
Tell me what exactly you need from the XML
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tested on an xpath-Tester site....
Now i write my own c# based test-app.
It works.
sorry, please don't be angry with me.
Thanks
Peter
Now i write my own c# based test-app.
It works.
sorry, please don't be angry with me.
Thanks
Peter
why angry?
don't worry,
it is a matter of finding where the issue is... we found it, so both happy :-)
don't worry,
it is a matter of finding where the issue is... we found it, so both happy :-)
Open in new window
But there is none in the example XML
for the primary key columns, columnType is 0 or 3 in this example