|
Home > Archive > BizTalk Server General > December 2004 > Discrepancy between BizTalk xpath examples and real world
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Discrepancy between BizTalk xpath examples and real world
|
|
|
| A minor gripe...
The xpath examples in the BizTalk docs at
http://msdn.microsoft.com/library/d...-us/sdk/htm/ebi
z_prog_orch_doho.asp demonstrate how easy and convenient xpath can be when
used in an expression. However, the reality is that it can be a real pain to
use it on messages in an expression shape. Here is a real example that
Darren Jefford posted:
xpath
("/*[local-name()='Order']/*[local-name()='Items']/*[local-name()='Item'][1]
")
It needs to be like this else it doesn't work. The examples in the BizTalk
docs would have it like this:
xpath ("/Order/Items/Item[1]")
But it just doesn't reflect the reality. The docs should be honest about
this.
| |
|
| In response to my own posting, It would be nice for BizTalk to introduce an
"ignore namespace" parameter to the xpath function so that the expressions
can be greatly simplified. Alternatively, introduce xpath 2.0 where I see
the syntax "*:Order" can be used which would select Order from any namespace
including the default.
"Xerox" <info@thinkscape.com> wrote in message
news:#A0KJL33EHA.2608@TK2MSFTNGP10.phx.gbl...
> A minor gripe...
>
> The xpath examples in the BizTalk docs at
>
http://msdn.microsoft.com/library/d...-us/sdk/htm/ebi
> z_prog_orch_doho.asp demonstrate how easy and convenient xpath can be when
> used in an expression. However, the reality is that it can be a real pain
to
> use it on messages in an expression shape. Here is a real example that
> Darren Jefford posted:
>
> xpath
>
("/*[local-name()='Order']/*[local-name()='Items']/*[local-name()='Item'][1]
> ")
>
> It needs to be like this else it doesn't work. The examples in the BizTalk
> docs would have it like this:
>
> xpath ("/Order/Items/Item[1]")
>
> But it just doesn't reflect the reality. The docs should be honest about
> this.
>
>
| |
| Hugo Rodger-Brown 2004-12-13, 3:26 am |
| Xerox - if you're using xpath on a messages whose schema you have defined in
BizTalk (i.e. not using the xs:anyType datatype as dicussed in another
post), you can get the BizTalk-friendly xpath by selecting the node in the
schema designer, and looking at the properties window.
(I agree, however, than when you first come to it then xpath syntax is very
complex.)
Hugo
"Xerox" <info@thinkscape.com> wrote in message
news:%23A0KJL33EHA.2608@TK2MSFTNGP10.phx.gbl...
> A minor gripe...
>
> The xpath examples in the BizTalk docs at
>
http://msdn.microsoft.com/library/d...-us/sdk/htm/ebi
> z_prog_orch_doho.asp demonstrate how easy and convenient xpath can be when
> used in an expression. However, the reality is that it can be a real pain
to
> use it on messages in an expression shape. Here is a real example that
> Darren Jefford posted:
>
> xpath
>
("/*[local-name()='Order']/*[local-name()='Items']/*[local-name()='Item'][1]
> ")
>
> It needs to be like this else it doesn't work. The examples in the BizTalk
> docs would have it like this:
>
> xpath ("/Order/Items/Item[1]")
>
> But it just doesn't reflect the reality. The docs should be honest about
> this.
>
>
| |
|
| Thats a great tip. Hadn't thought of looking at the properties for the node
path! Its just a shame that something that has such natural language syntax
as xpath is greatly complicated by all the local-name stuff. It'll be once
in a blue moon that there will be name clashes in a schema that need to be
resolved through a namespace prefix - thereby justifying the local-name
syntax. In all 99% other cases, local-name obfuscates the intent. If only
the xpath function accepted a boolean parameter to presume all node access
was local-name then this obfuscation can be avoided.
Oops - got on my soap box again!
"Hugo Rodger-Brown" <hugo@coldhams.com> wrote in message
news:eTlmjRP4EHA.3908@TK2MSFTNGP12.phx.gbl...
> Xerox - if you're using xpath on a messages whose schema you have defined
in
> BizTalk (i.e. not using the xs:anyType datatype as dicussed in another
> post), you can get the BizTalk-friendly xpath by selecting the node in the
> schema designer, and looking at the properties window.
>
> (I agree, however, than when you first come to it then xpath syntax is
very
> complex.)
>
> Hugo
>
> "Xerox" <info@thinkscape.com> wrote in message
> news:%23A0KJL33EHA.2608@TK2MSFTNGP10.phx.gbl...
>
http://msdn.microsoft.com/library/d...-us/sdk/htm/ebi
when[vbcol=seagreen]
pain[vbcol=seagreen]
> to
>
("/*[local-name()='Order']/*[local-name()='Items']/*[local-name()='Item'][1]
BizTalk[vbcol=seagreen]
>
>
| |
| HL7 Guy 2004-12-31, 5:48 pm |
| I haven't found this to be true at all. I have spent many hours tearing my
hair out over a very simple task - pulling data out of a populated HL7 ADT
XML document based on one of BizTalk's own HL7 Accelerator schemas. I have
used the Instance Path given in the XML document's node properties window and
gotten the same errors as everyone else.
The documentation for BizTalk is so poor, and the product's workarounds so
overly complex, that MS is shooting itself in the foot, making its best
product in years all but unusable. I would like to recommend BTS2K4, but if
the support and developer's documentation do not improve soon, I'll
discourage everyone I can from considering it!
"Xerox" wrote:
> Thats a great tip. Hadn't thought of looking at the properties for the node
> path! Its just a shame that something that has such natural language syntax
> as xpath is greatly complicated by all the local-name stuff. It'll be once
> in a blue moon that there will be name clashes in a schema that need to be
> resolved through a namespace prefix - thereby justifying the local-name
> syntax. In all 99% other cases, local-name obfuscates the intent. If only
> the xpath function accepted a boolean parameter to presume all node access
> was local-name then this obfuscation can be avoided.
>
> Oops - got on my soap box again!
>
> "Hugo Rodger-Brown" <hugo@coldhams.com> wrote in message
> news:eTlmjRP4EHA.3908@TK2MSFTNGP12.phx.gbl...
> in
> very
> http://msdn.microsoft.com/library/d...-us/sdk/htm/ebi
> when
> pain
> ("/*[local-name()='Order']/*[local-name()='Items']/*[local-name()='Item'][1]
> BizTalk
>
>
>
|
|
|
|
|