K
Kevin
I know this has probably been discussed many times before (I found
answers when I searched yesterday), but I still can't get it to
work...
I have an attribute @OID that can contain any characters (including
" and &apos
I have java code using Xerces to select a node based on it's @OID
attribute using an XPath like this:
"/MyElement[@OID = '" + sOID + "']" (done from memory - it's not
my code)
My first thought was that sOID should have all it's special characters
escaped (e.g. "l'hotel"), but this did not work - always
returning me null.
I read about the problem on the web and all the answers seemed to say
I was doing the right thing. So, I tried typing the XPath into
XMLSpy's XPath module, and it returned me nothing as well.
Am I missing something, or should this actually be working?
To test it, I created nodes with OID="<" OID=""" OID="'"
OID="&". After some experimentation it appears that if the "sOID"
variable contains non-escaped characters, the only node I cannot get
returned is OID="'", and if sOID contains escaped characters, I
cannot get any of these nodes returned.
Many thanks in advance, because this is driving me a bit crazy.
answers when I searched yesterday), but I still can't get it to
work...
I have an attribute @OID that can contain any characters (including
" and &apos
I have java code using Xerces to select a node based on it's @OID
attribute using an XPath like this:
"/MyElement[@OID = '" + sOID + "']" (done from memory - it's not
my code)
My first thought was that sOID should have all it's special characters
escaped (e.g. "l'hotel"), but this did not work - always
returning me null.
I read about the problem on the web and all the answers seemed to say
I was doing the right thing. So, I tried typing the XPath into
XMLSpy's XPath module, and it returned me nothing as well.
Am I missing something, or should this actually be working?
To test it, I created nodes with OID="<" OID=""" OID="'"
OID="&". After some experimentation it appears that if the "sOID"
variable contains non-escaped characters, the only node I cannot get
returned is OID="'", and if sOID contains escaped characters, I
cannot get any of these nodes returned.
Many thanks in advance, because this is driving me a bit crazy.