@@ -48,7 +48,7 @@ public function parse($data)
48
48
*/
49
49
private function parseCodelists (SimpleXMLElement $ xml )
50
50
{
51
- $ codelists = $ xml ->xpath ('// mes:Structure/mes:Structures/str:Codelists/str:Codelist ' );
51
+ $ codelists = $ xml ->xpath ('/mes:Structure/mes:Structures/str:Codelists/str:Codelist ' );
52
52
$ result = [];
53
53
foreach ($ codelists as $ codelist ) {
54
54
$ codelistName = $ this ->getCodelistName ($ codelist );
@@ -64,13 +64,13 @@ private function parseCodelists(SimpleXMLElement $xml)
64
64
*/
65
65
private function parseConcepts (SimpleXMLElement $ xml )
66
66
{
67
- $ conceptSchemes = $ xml ->xpath ('// mes:Structure/mes:Structures/str:Concepts/str:ConceptScheme ' );
67
+ $ conceptSchemes = $ xml ->xpath ('/mes:Structure/mes:Structures/str:Concepts/str:ConceptScheme ' );
68
68
$ result = [];
69
69
70
70
foreach ($ conceptSchemes as $ conceptScheme ) {
71
71
$ version = (string )$ conceptScheme ['version ' ];
72
72
$ agency = (string )$ conceptScheme ['agencyID ' ];
73
- $ concepts = $ conceptScheme ->xpath ('.// str:Concept ' );
73
+ $ concepts = $ conceptScheme ->xpath ('./str:Concept ' );
74
74
75
75
foreach ($ concepts as $ concept ) {
76
76
$ id = (string )$ concept ['id ' ];
@@ -88,7 +88,7 @@ private function parseConcepts(SimpleXMLElement $xml)
88
88
*/
89
89
private function getConceptName (SimpleXMLElement $ concept )
90
90
{
91
- $ name = $ concept ->xpath ('.// com:Name[@xml:lang="en"] ' );
91
+ $ name = $ concept ->xpath ('./com:Name[@xml:lang="en"] ' );
92
92
93
93
return count ($ name ) > 0 ? (string )$ name [0 ] : '' ;
94
94
}
@@ -103,7 +103,7 @@ private function parseDataStructures(SimpleXMLElement $xml, array $codelists, ar
103
103
{
104
104
$ result = [];
105
105
106
- $ structures = $ xml ->xpath ('// mes:Structure/mes:Structures/str:DataStructures/str:DataStructure ' );
106
+ $ structures = $ xml ->xpath ('/mes:Structure/mes:Structures/str:DataStructures/str:DataStructure ' );
107
107
foreach ($ structures as $ structure ) {
108
108
$ result [] = $ this ->parseDataStructure ($ structure , $ codelists , $ concepts );
109
109
}
@@ -136,7 +136,7 @@ private function fillDsMainData(SimpleXMLElement $structure, DataflowStructure $
136
136
$ flowStructure ->setAgency ((string )$ structure ['agencyID ' ]);
137
137
$ flowStructure ->setId ((string )$ structure ['id ' ]);
138
138
$ flowStructure ->setVersion ((string )$ structure ['version ' ]);
139
- $ name = $ structure ->xpath ('.// com:Name[@xml:lang="en"] ' );
139
+ $ name = $ structure ->xpath ('./com:Name[@xml:lang="en"] ' );
140
140
if (count ($ name ) > 0 ) {
141
141
$ flowStructure ->setName ((string )$ name [0 ]);
142
142
}
@@ -150,7 +150,7 @@ private function fillDsMainData(SimpleXMLElement $structure, DataflowStructure $
150
150
*/
151
151
private function fillDsDimensionData (SimpleXMLElement $ structure , DataflowStructure $ flowStructure , array $ codelists , array $ concepts )
152
152
{
153
- $ dimensions = $ structure ->xpath ('.// str:DataStructureComponents/str:DimensionList/str:Dimension ' );
153
+ $ dimensions = $ structure ->xpath ('./str:DataStructureComponents/str:DimensionList/str:Dimension ' );
154
154
$ position = 0 ;
155
155
foreach ($ dimensions as $ dimension ) {
156
156
$ parsedDimension = $ this ->parseDimension ($ dimension , $ concepts , ++$ position );
@@ -190,7 +190,7 @@ private function parseDimension(SimpleXMLElement $dimension, array $concepts, $p
190
190
*/
191
191
private function parseDimensionCodeList (SimpleXMLElement $ dimension )
192
192
{
193
- $ localRepresentation = $ dimension ->xpath ('.// str:LocalRepresentation/str:Enumeration/Ref ' );
193
+ $ localRepresentation = $ dimension ->xpath ('./str:LocalRepresentation/str:Enumeration/Ref ' );
194
194
195
195
if (count ($ localRepresentation ) == 0 ) {
196
196
return null ;
@@ -212,7 +212,7 @@ private function parseDimensionCodeList(SimpleXMLElement $dimension)
212
212
*/
213
213
private function getDimensionName (SimpleXMLElement $ dimension , array $ concepts )
214
214
{
215
- $ concept = $ dimension ->xpath ('.// str:ConceptIdentity/Ref ' );
215
+ $ concept = $ dimension ->xpath ('./str:ConceptIdentity/Ref ' );
216
216
217
217
if (count ($ concept ) == 0 ) {
218
218
return '' ;
@@ -232,7 +232,7 @@ private function getDimensionName(SimpleXMLElement $dimension, array $concepts)
232
232
*/
233
233
private function parseTimeDimension (SimpleXMLElement $ structure )
234
234
{
235
- $ timeDimension = $ structure ->xpath ('.// str:DataStructureComponents/str:DimensionList/str:TimeDimension ' );
235
+ $ timeDimension = $ structure ->xpath ('./str:DataStructureComponents/str:DimensionList/str:TimeDimension ' );
236
236
237
237
if (count ($ timeDimension ) == 0 ) {
238
238
return '' ;
0 commit comments