aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmerl/src/xmerl_xpath_pred.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2010-12-07 11:30:05 +0100
committerLars Thorsen <[email protected]>2011-11-11 11:58:43 +0100
commitef8ba559efdef989a5c608ac40635410500395df (patch)
treef45005e0b683676ef0393008d4452d39da459d21 /lib/xmerl/src/xmerl_xpath_pred.erl
parent5b9aeb694cc7839163f684244c37a3029b9a1c8e (diff)
downloadotp-ef8ba559efdef989a5c608ac40635410500395df.tar.gz
otp-ef8ba559efdef989a5c608ac40635410500395df.tar.bz2
otp-ef8ba559efdef989a5c608ac40635410500395df.zip
Implement namespace axis
Namespace nodes are represented as `#xmlNsNode` records. Now that the namespace axis is correctly implemented, attributes nodes corresponding to attributes that declare namespaces are ignored. See [5.3 Attribute Nodes][xpath-5.3]: > There are no attribute nodes corresponding to attributes > that declare namespaces. [xpath-5.3]: http://www.w3.org/TR/xpath/#attribute-nodes
Diffstat (limited to 'lib/xmerl/src/xmerl_xpath_pred.erl')
-rw-r--r--lib/xmerl/src/xmerl_xpath_pred.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/xmerl/src/xmerl_xpath_pred.erl b/lib/xmerl/src/xmerl_xpath_pred.erl
index 9ad7925111..855b8599fe 100644
--- a/lib/xmerl/src/xmerl_xpath_pred.erl
+++ b/lib/xmerl/src/xmerl_xpath_pred.erl
@@ -337,6 +337,9 @@ local_name1([#xmlNode{type=element,node=El}|_]) ->
local_name1([#xmlNode{type=attribute,node=Att}|_]) ->
#xmlAttribute{name=Name,nsinfo=NSI} = Att,
local_name2(Name,NSI);
+local_name1([#xmlNode{type=namespace,node=N}|_]) ->
+ #xmlNsNode{prefix=Prefix} = N,
+ ?string(Prefix);
local_name1([#xmlElement{name = Name, nsinfo = NSI}|_]) ->
local_name2(Name,NSI).
local_name2(Name, NSI) ->
@@ -431,6 +434,9 @@ string_value(N=#xmlObj{}) ->
string_value(A=#xmlNode{type=attribute}) ->
#xmlAttribute{value=AttVal}=A#xmlNode.node,
?string(AttVal);
+string_value(N=#xmlNode{type=namespace}) ->
+ #xmlNsNode{uri=URI}=N#xmlNode.node,
+ ?string(atom_to_list(URI));
string_value(El=#xmlNode{type=element}) ->
#xmlElement{content=C} = El#xmlNode.node,
TextValue = fun(#xmlText{value=T},_Fun) -> T;