@@ -865,22 +865,9 @@ package body SOAP.Message.XML is
865
865
function Parse_Any_URI
866
866
(Name : String;
867
867
Type_Name : String;
868
- N : DOM.Core.Node) return Types.Object'Class
869
- is
870
- use type DOM.Core.Node_Types;
871
-
872
- L : constant DOM.Core.Node_List := Child_Nodes (N);
873
- S : Unbounded_String;
874
- P : DOM.Core.Node;
868
+ N : DOM.Core.Node) return Types.Object'Class is
875
869
begin
876
- for I in 0 .. Length (L) - 1 loop
877
- P := Item (L, I);
878
- if P.Node_Type = DOM.Core.Text_Node then
879
- Append (S, Node_Value (P));
880
- end if ;
881
- end loop ;
882
-
883
- return Types.AnyURI (To_String (S), Name, Type_Name);
870
+ return Types.AnyURI (SOAP.XML.Text_Node_Value (N), Name, Type_Name);
884
871
end Parse_Any_URI ;
885
872
886
873
-- ---------------
@@ -1406,11 +1393,9 @@ package body SOAP.Message.XML is
1406
1393
function Parse_Normalized_String
1407
1394
(Name : String;
1408
1395
Type_Name : String;
1409
- N : DOM.Core.Node) return Types.Object'Class
1410
- is
1411
- Value : constant DOM.Core.Node := First_Child (N);
1396
+ N : DOM.Core.Node) return Types.Object'Class is
1412
1397
begin
1413
- return Types.NS (Node_Value (Value ), Name, Type_Name);
1398
+ return Types.NS (SOAP.XML.Text_Node_Value (N ), Name, Type_Name);
1414
1399
end Parse_Normalized_String ;
1415
1400
1416
1401
-- ---------------
@@ -1862,22 +1847,10 @@ package body SOAP.Message.XML is
1862
1847
function Parse_String
1863
1848
(Name : String;
1864
1849
Type_Name : String;
1865
- N : DOM.Core.Node) return Types.Object'Class
1866
- is
1867
- use type DOM.Core.Node_Types;
1868
-
1869
- L : constant DOM.Core.Node_List := Child_Nodes (N);
1870
- S : Unbounded_String;
1871
- P : DOM.Core.Node;
1850
+ N : DOM.Core.Node) return Types.Object'Class is
1872
1851
begin
1873
- for I in 0 .. Length (L) - 1 loop
1874
- P := Item (L, I);
1875
- if P.Node_Type = DOM.Core.Text_Node then
1876
- Append (S, Node_Value (P));
1877
- end if ;
1878
- end loop ;
1879
-
1880
- return Types.XSD_String'(Types.S (S, Name, Type_Name));
1852
+ return Types.XSD_String'
1853
+ (Types.S (SOAP.XML.Text_Node_Value (N), Name, Type_Name));
1881
1854
end Parse_String ;
1882
1855
1883
1856
-- --------------
@@ -1917,12 +1890,10 @@ package body SOAP.Message.XML is
1917
1890
function Parse_Token
1918
1891
(Name : String;
1919
1892
Type_Name : String;
1920
- N : DOM.Core.Node) return Types.Object'Class
1921
- is
1922
- Value : constant DOM.Core.Node := First_Child (N);
1893
+ N : DOM.Core.Node) return Types.Object'Class is
1923
1894
begin
1924
1895
return Types.XSD_Token'
1925
- (Types.T (Node_Value (Value ), Name, Type_Name));
1896
+ (Types.T (SOAP.XML.Text_Node_Value (N ), Name, Type_Name));
1926
1897
end Parse_Token ;
1927
1898
1928
1899
-- -----------------------
@@ -1991,23 +1962,9 @@ package body SOAP.Message.XML is
1991
1962
1992
1963
function Parse_Untyped
1993
1964
(Name : String;
1994
- N : DOM.Core.Node) return Types.Object'Class
1995
- is
1996
- use type DOM.Core.Node_Types;
1997
-
1998
- L : constant DOM.Core.Node_List := Child_Nodes (N);
1999
- S : Unbounded_String;
2000
- P : DOM.Core.Node;
1965
+ N : DOM.Core.Node) return Types.Object'Class is
2001
1966
begin
2002
- for I in 0 .. Length (L) - 1 loop
2003
- P := Item (L, I);
2004
-
2005
- if P.Node_Type = DOM.Core.Text_Node then
2006
- Append (S, Node_Value (P));
2007
- end if ;
2008
- end loop ;
2009
-
2010
- return Types.Untyped.S (S, Name);
1967
+ return Types.Untyped.S (SOAP.XML.Text_Node_Value (N), Name);
2011
1968
end Parse_Untyped ;
2012
1969
2013
1970
-- -----------------
0 commit comments