DOM.xs

filter: Statementstmt 0.0% 0 / 158 Branchbran 0.0% 0 / 90 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 248 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« Cmd.xs ↑ Summary Embperl.xs »
1 ###################################################################################
2 #
3 # Embperl - Copyright (c) 1997-2008 Gerald Richter / ecos gmbh www.ecos.de
4 # Embperl - Copyright (c) 2008-2015 Gerald Richter
5 # Embperl - Copyright (c) 2015-2023 actevy.io
6 #
7 # You may distribute under the terms of either the GNU General Public
8 # License or the Artistic License, as specified in the Perl README file.
9 # For use with Apache httpd and mod_perl, see also Apache copyright.
10 #
11 # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
12 # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13 # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14 #
15 ###################################################################################
16  
17  
18  
19 MODULE = XML::Embperl::DOM PACKAGE = XML::Embperl::DOM PREFIX = embperl_
20  
21  
22 ################################################################################
23  
24 MODULE = XML::Embperl::DOM PACKAGE = XML::Embperl::DOM::Node PREFIX = embperl_Node_
25  
26 void
27 embperl_Node_attach (pRV,xDomTree,xNode)
28 SV * pRV ;
29 int xDomTree
30 int xNode
31 CODE:
32 tDomNode * pDomNode ;
33 MAGIC * mg ;
34 0 SV * pSV = SvRV(pRV) ;
35 0 ▶ if ((mg = mg_find (pSV, '~')))
Branch: 1 branch
BranchTrueFalseTotal
if ((mg = mg_find (pSV, '~'))) 0 0 0
36 {
37 0 pDomNode = (tDomNode *)(mg -> mg_ptr) ;
38 0 ▶ if (xDomTree)
Branch: 1 branch
BranchTrueFalseTotal
if (xDomTree) 0 0 0
39 0 pDomNode -> xDomTree = xDomTree ;
40 0 ▶ if (xNode)
Branch: 1 branch
BranchTrueFalseTotal
if (xNode) 0 0 0
41 0 pDomNode -> xNode = xNode ;
42 }
43 else
44 {
45 0 Newc (0, pDomNode, 1, sizeof (tDomNode), tDomNode) ;
46 0 pDomNode -> xDomTree = xDomTree ;
47 0 pDomNode -> xNode = xNode ;
48 0 pDomNode -> pDomNodeSV = pRV ;
49 /* sv_unmagic ((SV *)pSV, '~') ; */
50 0 sv_magic ((SV *)pSV, NULL, '~', (char *)&pDomNode, sizeof (pDomNode)) ;
51 /* sv_bless (pRV, gv_stashpv ("XML::Embperl::DOM::Node", 0)) ; */
52 }
53
54  
55  
56 SV *
57 embperl_Node_replaceChildWithCDATA (CurrApp, pDomNode,sText)
58 tDomNode * pDomNode
59 SV * sText
60 PREINIT:
61 STRLEN l ;
62 char * s ;
63 0 tReq * r = CurrReq ;
64 PPCODE:
65 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
66 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
67 0 RETVAL = NULL ; /* avoid warning */
68 0 SvGETMAGIC_P4(sText) ;
69 0 ▶ s = SV2String (sText, l) ;
Branch: 1 branch
BranchTrueFalseTotal
s = SV2String (sText, l) ; 0 0 0
70 0 ▶ Node_replaceChildWithCDATA (CurrApp, DomTree_self(pDomNode -> xDomTree), pDomNode -> xNode, r -> Component.nCurrRepeatLevel, s, l, (SvUTF8(sText)?nflgEscUTF8:0) + ((r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode), 0) ;
Branch: 1 branch
BranchTrueFalseTotal
Node_replaceChildWithCDATA (CurrApp, DomTree_self(pDomNode -> xDomTree), pDomNode -> xNode, r -> Component.nCurrRepeatLevel, s, l, (SvUTF8(sText)?nflgEscUTF8:0) + ((r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode), 0) ; 0 0 0
71 0 r -> Component.nCurrEscMode = r -> Component.Config.nEscMode ;
72 0 r -> Component.bEscModeSet = -1 ;
73 /*SvREFCNT_inc (sText) ;*/
74 0 ST(0) = sText ;
75 0 XSRETURN(1) ;
76  
77  
78 SV *
79 embperl_Node_XXiReplaceChildWithCDATA (xDomTree, xOldChild,sText)
80 int xDomTree
81 int xOldChild
82 SV * sText
83 PREINIT:
84 STRLEN l ;
85 char * s ;
86 0 tReq * r = CurrReq ;
87 PPCODE:
88 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
89 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
90 0 RETVAL = NULL ; /* avoid warning */
91 0 SvGETMAGIC_P4(sText) ;
92 0 ▶ s = SV2String (sText, l) ;
Branch: 1 branch
BranchTrueFalseTotal
s = SV2String (sText, l) ; 0 0 0
93 0 ▶ Node_replaceChildWithCDATA (CurrApp, DomTree_self(xDomTree), xOldChild, r -> Component.nCurrRepeatLevel, s, l, (SvUTF8(sText)?nflgEscUTF8:0) + ((r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode), 0) ;
Branch: 1 branch
BranchTrueFalseTotal
Node_replaceChildWithCDATA (CurrApp, DomTree_self(xDomTree), xOldChild, r -> Component.nCurrRepeatLevel, s, l, (SvUTF8(sText)?nflgEscUTF8:0) + ((r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode), 0) ; 0 0 0
94 0 r -> Component.nCurrEscMode = r -> Component.Config.nEscMode ;
95 0 r -> Component.bEscModeSet = -1 ;
96 /*SvREFCNT_inc (sText) ;*/
97 0 ST(0) = sText ;
98 0 XSRETURN(1) ;
99  
100  
101 SV *
102 embperl_Node_iReplaceChildWithCDATA (xOldChild,sText)
103 int xOldChild
104 SV * sText
105 PREINIT:
106 STRLEN l ;
107 char * s ;
108 0 tReq * r = CurrReq ;
109 PPCODE:
110 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
111 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
112 0 RETVAL = NULL ; /* avoid warning */
113 0 r -> Component.bSubNotEmpty = 1 ;
114 0 SvGETMAGIC_P4(sText) ;
115 0 ▶ s = SV2String (sText, l) ;
Branch: 1 branch
BranchTrueFalseTotal
s = SV2String (sText, l) ; 0 0 0
116 0 ▶ Node_replaceChildWithCDATA (r -> pApp, DomTree_self(r -> Component.xCurrDomTree), xOldChild, r -> Component.nCurrRepeatLevel, s, l, (SvUTF8(sText)?nflgEscUTF8:0) + ((r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode), 0) ;
Branch: 1 branch
BranchTrueFalseTotal
Node_replaceChildWithCDATA (r -> pApp, DomTree_self(r -> Component.xCurrDomTree), xOldChild, r -> Component.nCurrRepeatLevel, s, l, (SvUTF8(sText)?nflgEscUTF8:0) + ((r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode), 0) ; 0 0 0
117 0 r -> Component.nCurrEscMode = r -> Component.Config.nEscMode ;
118 0 r -> Component.bEscModeSet = -1 ;
119 /*SvREFCNT_inc (sText) ;*/
120 0 ST(0) = sText ;
121 0 XSRETURN(1) ;
122  
123  
124 void
125 embperl_Node_iReplaceChildWithMsgId (xOldChild,sId)
126 int xOldChild
127 char * sId
128 PREINIT:
129 STRLEN l ;
130 const char * s ;
131 0 tReq * r = CurrReq ;
132 PPCODE:
133 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
134 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
135 0 r -> Component.bSubNotEmpty = 1 ;
136 0 s = embperl_GetText (r, sId) ;
137 0 l = strlen (s) ;
138 0 ▶ Node_replaceChildWithCDATA (r -> pApp, DomTree_self(r -> Component.xCurrDomTree), xOldChild, r -> Component.nCurrRepeatLevel, s, l, (r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode, 0) ;
Branch: 1 branch
BranchTrueFalseTotal
Node_replaceChildWithCDATA (r -> pApp, DomTree_self(r -> Component.xCurrDomTree), xOldChild, r -> Component.nCurrRepeatLevel, s, l, (r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode, 0) ; 0 0 0
139 0 r -> Component.nCurrEscMode = r -> Component.Config.nEscMode ;
140 0 r -> Component.bEscModeSet = -1 ;
141  
142  
143  
144 SV *
145 embperl_Node_replaceChildWithUrlDATA (pDomNode,sText)
146 tDomNode * pDomNode
147 SV * sText
148 PREINIT:
149 SV * sRet ;
150 0 tReq * r = CurrReq ;
151 PPCODE:
152 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
153 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
154 0 RETVAL = NULL ; /* avoid warning */
155 0 SvGETMAGIC_P4(sText) ;
156 0 sRet = Node_replaceChildWithUrlDATA (r, pDomNode -> xDomTree, pDomNode -> xNode, r -> Component.nCurrRepeatLevel, sText) ;
157  
158 0 ST(0) = sRet ;
159 0 XSRETURN(1) ;
160  
161 SV *
162 embperl_Node_iReplaceChildWithUrlDATA (xOldChild,sText)
163 int xOldChild
164 SV * sText
165 PREINIT:
166 SV * sRet ;
167 0 tReq * r = CurrReq ;
168 PPCODE:
169 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
170 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
171 0 RETVAL = NULL ; /* avoid warning */
172 0 r -> Component.bSubNotEmpty = 1 ;
173 0 SvGETMAGIC_P4(sText) ;
174 0 sRet = Node_replaceChildWithUrlDATA (r, r -> Component.xCurrDomTree, xOldChild, r -> Component.nCurrRepeatLevel, sText) ;
175  
176 0 ST(0) = sRet ;
177 0 XSRETURN(1) ;
178  
179  
180 void
181 embperl_Node_removeChild (pDomNode)
182 tDomNode * pDomNode
183 CODE:
184 0 Node_removeChild (CurrApp, DomTree_self (pDomNode -> xDomTree), -1, pDomNode -> xNode, 0) ;
185  
186  
187 void
188 embperl_Node_iRemoveChild (xDomTree, xChild)
189 int xDomTree
190 int xChild
191 CODE:
192 0 Node_removeChild (CurrApp, DomTree_self (xDomTree), -1, xChild, 0) ;
193  
194  
195 void
196 embperl_Node_appendChild (pParentNode, nType, sText)
197 tDomNode * pParentNode
198 int nType
199 SV * sText
200 PREINIT:
201 STRLEN nText ;
202 char * sT ;
203 tDomTree * pDomTree ;
204 0 tReq * r = CurrReq ;
205 CODE:
206 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
207 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
208 0 ▶ sT = SV2String (sText, nText) ;
Branch: 1 branch
BranchTrueFalseTotal
sT = SV2String (sText, nText) ; 0 0 0
209 0 pDomTree = DomTree_self(pParentNode -> xDomTree) ;
210 0 Node_appendChild (r -> pApp, pDomTree, pParentNode -> xNode, r -> Component.nCurrRepeatLevel, (tNodeType)nType, 0, sT, nText, 0, 0, NULL) ;
211  
212  
213 void
214 embperl_Node_iAppendChild (xDomTree, xParent, nType, sText)
215 int xDomTree
216 int xParent
217 int nType
218 SV * sText
219 tReq * r = CurrReq ;
220 CODE:
221 STRLEN nText ;
222 tNodeData * pNode ;
223 tNode xNode ;
224 0 ▶ int nEscMode = (SvUTF8(sText)?escHtmlUtf8:0) + ((r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode) ;
Branch: 1 branch
BranchTrueFalseTotal
int nEscMode = (SvUTF8(sText)?escHtmlUtf8:0) + ((r -> Component.nCurrEscMode & 11)== 3?1 + (r -> Component.nCurrEscMode & 4):r -> Component.nCurrEscMode) ; 0 0 0
225 0 ▶ char * sT = SV2String (sText, nText) ;
Branch: 1 branch
BranchTrueFalseTotal
char * sT = SV2String (sText, nText) ; 0 0 0
226 0 tDomTree * pDomTree = DomTree_self(xDomTree) ;
227 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
228 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
229 0 xNode = Node_appendChild (r -> pApp, pDomTree, xParent, r -> Component.nCurrRepeatLevel, (tNodeType)nType, 0, sT, nText, 0, 0, NULL) ;
230 0 pNode = Node_self(pDomTree,xNode) ;
231 0 ▶ pNode -> nType = (nEscMode & 8)?ntypText:((nEscMode & 3)?ntypTextHTML:ntypCDATA) ;
Branch: 2 branches
BranchTrueFalseTotal
pNode -> nType = (nEscMode & 8)?ntypText:((nEscMode & 3)?ntypTextHTML:ntypCDATA) ; 0 0 0
pNode -> nType = (nEscMode & 8)?ntypText:((nEscMode & 3)?ntypTextHTML:ntypCDATA) ; 0 0 0
232 0 pNode -> bFlags &= ~(nflgEscUTF8 + nflgEscUrl + nflgEscChar) ;
233 0 pNode -> bFlags |= (nEscMode ^ nflgEscChar) & (nflgEscUTF8 + nflgEscUrl + nflgEscChar) ;
234
235  
236 char *
237 embperl_Node_iChildsText (xDomTree, xChild, bDeep=0)
238 int xDomTree
239 int xChild
240 int bDeep
241 PREINIT:
242 char * sText ;
243 0 ▶ tReq * r = CurrReq ;
Branch: 1 branch
BranchTrueFalseTotal
tReq * r = CurrReq ; 0 0 0
244 CODE:
245 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
246 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
247 0 sText = Node_childsText (r -> pApp, DomTree_self (xDomTree), xChild, r -> Component.nCurrRepeatLevel, 0, bDeep) ;
248 0 ▶ RETVAL = sText?sText:"" ;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = sText?sText:"" ; 0 0 0
249 OUTPUT:
250 RETVAL
251 CLEANUP:
252 0 StringFree (r -> pApp, &sText) ;
253  
254  
255 void
256 embperl_Node_iSetText (xDomTree, xNode, sText)
257 int xDomTree
258 int xNode
259 SV * sText
260 PREINIT:
261 STRLEN nText ;
262 char * sT ;
263 0 tApp * a = CurrReq -> pApp ;
264 0 tNodeData * pNode = Node_self(DomTree_self(xDomTree), xNode) ;
265 CODE:
266 0 ▶ sT = SV2String (sText, nText) ;
Branch: 1 branch
BranchTrueFalseTotal
sT = SV2String (sText, nText) ; 0 0 0
267 0 ▶ if (pNode -> nText)
Branch: 1 branch
BranchTrueFalseTotal
if (pNode -> nText) 0 0 0
268 0 NdxStringFree (a, pNode -> nText) ;
269 0 pNode -> nText = String2Ndx (a, sT, nText) ;
270  
271  
272  
273 ################################################################################
274  
275 MODULE = XML::Embperl::DOM PACKAGE = XML::Embperl::DOM::Tree PREFIX = embperl_DomTree_
276  
277 void
278 embperl_DomTree_iCheckpoint (nCheckpoint)
279 int nCheckpoint
280 PREINIT:
281 0 tReq * r = CurrReq ;
282 CODE:
283 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
284 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
285 0 r -> Component.nCurrEscMode = r -> Component.Config.nEscMode ;
286 0 r -> Component.bEscModeSet = -1 ;
287 0 DomTree_checkpoint (r, nCheckpoint) ;
288  
289 void
290 embperl_DomTree_iDiscardAfterCheckpoint (nCheckpoint)
291 int nCheckpoint
292 CODE:
293 0 DomTree_discardAfterCheckpoint (CurrReq, nCheckpoint) ;
294  
295 #void
296 #Node_parentNode (xChild)
297 # int xChild
298 #
299 #void
300 #Node_firstChild (xChild)
301 # int xChild
302  
303  
304 ################################################################################
305  
306 MODULE = XML::Embperl::DOM PACKAGE = XML::Embperl::DOM::Element PREFIX = embperl_Element_
307  
308  
309 void
310 embperl_Element_setAttribut (pDomNode, sAttr, sText)
311 tDomNode * pDomNode
312 SV * sAttr
313 SV * sText
314 PREINIT:
315 STRLEN nAttr ;
316 STRLEN nText ;
317 char * sT ;
318 char * sA ;
319 tDomTree * pDomTree ;
320 0 tReq * r = CurrReq ;
321 SV * sEscapedText ;
322 CODE:
323 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
324 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
325 0 ▶ sT = SV2String (sText, nText) ;
Branch: 1 branch
BranchTrueFalseTotal
sT = SV2String (sText, nText) ; 0 0 0
326 0 ▶ sA = SV2String (sAttr, nAttr) ;
Branch: 1 branch
BranchTrueFalseTotal
sA = SV2String (sAttr, nAttr) ; 0 0 0
327  
328 0 sEscapedText = Escape (r, sT, nText, (SvUTF8(sText)?escHtmlUtf8:0) + r -> Component.nCurrEscMode, NULL, '\0') ;
329 0 ▶ sT = SV2String (sEscapedText, nText) ;
Branch: 1 branch
BranchTrueFalseTotal
sT = SV2String (sEscapedText, nText) ; 0 0 0
330  
331 0 pDomTree = DomTree_self (pDomNode -> xDomTree) ;
332  
333 0 Element_selfSetAttribut (r -> pApp, pDomTree, Node_self (pDomTree, pDomNode -> xNode), r -> Component.nCurrRepeatLevel, sA, nAttr, sT, nText) ;
334 0 SvREFCNT_dec (sEscapedText) ;
335  
336  
337 void
338 embperl_Element_iSetAttribut (xDomTree, xNode, sAttr, sText)
339 int xDomTree
340 int xNode
341 SV * sAttr
342 SV * sText
343 PREINIT:
344 0 tReq * r = CurrReq ;
345 SV * sEscapedText ;
346 tDomTree * pDomTree ;
347 CODE:
348 STRLEN nAttr ;
349 STRLEN nText ;
350 0 ▶ char * sT = SV2String (sText, nText) ;
Branch: 1 branch
BranchTrueFalseTotal
char * sT = SV2String (sText, nText) ; 0 0 0
351 0 ▶ char * sA = SV2String (sAttr, nAttr) ;
Branch: 1 branch
BranchTrueFalseTotal
char * sA = SV2String (sAttr, nAttr) ; 0 0 0
352 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
353 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
354 0 sEscapedText = Escape (r, sT, nText, (SvUTF8(sText)?escHtmlUtf8:0) + r -> Component.nCurrEscMode, NULL, '\0') ;
355 0 ▶ sT = SV2String (sEscapedText, nText) ;
Branch: 1 branch
BranchTrueFalseTotal
sT = SV2String (sEscapedText, nText) ; 0 0 0
356 0 pDomTree = DomTree_self (xDomTree) ;
357  
358 0 Element_selfSetAttribut (r -> pApp, pDomTree, Node_self (pDomTree, xNode), r -> Component.nCurrRepeatLevel, sA, nAttr, sT, nText) ;
359 0 SvREFCNT_dec (sEscapedText) ;
360  
361  
362  
363  
364 void
365 embperl_Element_removeAttribut (pDomNode, xNode, sAttr)
366 tDomNode * pDomNode
367 SV * sAttr
368 PREINIT:
369 STRLEN nAttr ;
370 char * sA ;
371 tDomTree * pDomTree ;
372 0 tReq * r = CurrReq ;
373 CODE:
374 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
375 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
376 0 ▶ sA = SV2String (sAttr, nAttr) ;
Branch: 1 branch
BranchTrueFalseTotal
sA = SV2String (sAttr, nAttr) ; 0 0 0
377 0 pDomTree = DomTree_self (pDomNode -> xDomTree) ;
378  
379 0 Element_selfRemoveAttribut (r -> pApp, pDomTree, Node_self (pDomTree, pDomNode -> xNode), r -> Component.nCurrRepeatLevel, sA, nAttr) ;
380  
381  
382 void
383 embperl_Element_iRemoveAttribut (xDomTree, xNode, sAttr)
384 int xDomTree
385 int xNode
386 SV * sAttr
387 PREINIT:
388 0 tReq * r = CurrReq ;
389 CODE:
390 STRLEN nAttr ;
391 0 ▶ char * sA = SV2String (sAttr, nAttr) ;
Branch: 1 branch
BranchTrueFalseTotal
char * sA = SV2String (sAttr, nAttr) ; 0 0 0
392 0 tDomTree * pDomTree = DomTree_self (xDomTree) ;
393 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
394 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
395  
396 0 Element_selfRemoveAttribut (r -> pApp, pDomTree, Node_self (pDomTree, xNode), r -> Component.nCurrRepeatLevel, sA, nAttr) ;
397  
398  
399 ################################################################################
400  
401 MODULE = XML::Embperl::DOM PACKAGE = XML::Embperl::DOM::Attr PREFIX = embperl_Attr_
402  
403  
404  
405 SV *
406 embperl_Attr_value (pAttr)
407 tDomNode * pAttr
408 PREINIT:
409 tDomTree * pDomTree ;
410 0 char * sAttrText = NULL ;
411 0 tReq * r = CurrReq ;
412 CODE:
413 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
414 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
415 0 pDomTree = DomTree_self (pAttr -> xDomTree) ;
416  
417 0 Attr_selfValue (r -> pApp, pDomTree, Attr_self(pDomTree, pAttr -> xNode), r -> Component.nCurrRepeatLevel, &sAttrText) ;
418 0 ▶ RETVAL = sAttrText?newSVpv (sAttrText, 0):&sv_undef ;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = sAttrText?newSVpv (sAttrText, 0):&sv_undef ; 0 0 0
419 0 StringFree (r -> pApp, &sAttrText) ;
420 OUTPUT:
421 RETVAL
422  
423  
424 SV *
425 embperl_Attr_iValue (xDomTree, xAttr)
426 int xDomTree
427 int xAttr
428 PREINIT:
429 0 tReq * r = CurrReq ;
430 CODE:
431 0 tDomTree * pDomTree = DomTree_self (xDomTree) ;
432 0 char * sAttrText = NULL ;
433 tAttrData * pAttr ;
434
435 0 ▶ if (!r)
Branch: 1 branch
BranchTrueFalseTotal
if (!r) 0 0 0
436 0 Perl_croak(aTHX_ "$Embperl::req undefined %s %d", __FILE__, __LINE__) ;
437 /* lprintf (CurrReq, "xDomTree=%d, xAttr=%d pDomTree=%x\n", xDomTree, xAttr, pDomTree) ;*/
438
439 0 pAttr = Attr_self(pDomTree, xAttr) ;
440 0 Attr_selfValue (r -> pApp, pDomTree, pAttr , r -> Component.nCurrRepeatLevel, &sAttrText) ;
441 0 ▶ RETVAL = sAttrText?newSVpv (sAttrText, 0):&sv_undef ;
Branch: 1 branch
BranchTrueFalseTotal
RETVAL = sAttrText?newSVpv (sAttrText, 0):&sv_undef ; 0 0 0
442 0 StringFree (r -> pApp, &sAttrText) ;
443 OUTPUT:
444 RETVAL
445  
« Cmd.xs ↑ Summary Embperl.xs »