23 $heavyTag = trim($heavyTag);
27 $attrsPos = mb_strpos($heavyTag,
" ");
31 $name = mb_substr($heavyTag, 0, $attrsPos);
32 $attrs = mb_strstr(trim($heavyTag),
" ");
35 if (!trim(
$name))
return false;
37 $nameSplited = explode(
":",
$name);
44 if ($attrs and mb_strlen($attrs))
46 $attrsSplit = explode(
"\"", $attrs);
48 while ($validi = mb_strpos(trim($attrsSplit[
$i]),
"="))
50 $attrsSplit[
$i] = trim($attrsSplit[
$i]);
56 $node->setAttribute($attrName, $attrValue);
62 $node->setData($value);
69 global $xsd_simple_type;
74 ShowError(
"Tag name undefined (== 0) in encodeValueLight.");
83 ShowError(
"Can't create NODE object. Unable to parse tag name: ".
$name);
87 if (is_object($value) && mb_strtolower(get_class($value)) ==
"cxmlcreator")
89 $node->addChild($value);
91 else if (is_object($value))
93 $ovars = get_object_vars($value);
94 foreach ($ovars as $pn => $pv)
97 if ($decode) $node->addChild($decode);
100 else if (is_array($value))
102 foreach ($value as $pn => $pv)
107 $node->addChild($decode);
113 if (!$value) $node->setData(
"");
114 else if (!isset($xsd_simple_type[gettype($value)]))
120 $node->setData($value);
128 $this->startCDATA =
"<![CDATA[";
129 $this->endCDATA =
"]]>";
134 $newAttribute =
array($attrName => $attrValue);
135 $this->attributs = array_merge($this->attributs, $newAttribute);
152 if($element && (get_class($element) ==
"CXMLCreator" || get_class($element) ==
"cxmlcreator"))
154 array_push($this->children, $element);
160 return count($this->children);
166 if (is_array($this->attributs)){
167 foreach($this->attributs as
$key=>
$val)
169 $attributs .=
" " . static::xmlspecialchars(
$key).
"=\"" . static::xmlspecialchars(
$val) .
"\"";
178 foreach($this->children as
$key=>
$val)
188 if (!$this->tag)
return "";
189 $xml =
"<" . static::xmlspecialchars($this->tag) . $this->
_getAttributs() .
">";
194 $xml .=
"</" . static::xmlspecialchars($this->tag) .
">";
200 return "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
217 $result->setData($domNode->content);
219 if (is_array($domNode->attributes))
221 foreach ($domNode->attributes as $attrDomNode)
223 $result->setAttribute($attrDomNode->name, $attrDomNode->content);
227 if (is_array($domNode->children))
229 foreach ($domNode->children as $domChild)
240 static $search =
array(
"&",
"<",
">",
"\"",
"'",
"\r",
"\n");
241 static $replace =
array(
"&",
"<",
">",
""",
"'",
" ",
" ");
242 return str_replace($search, $replace,
$str);
247 static $search =
array(
"<",
">",
""",
"'",
"&",
" ",
" ");
248 static $replace =
array(
"<",
">",
"\"",
"'",
"&",
"\r",
"\n");
249 return str_replace($search, $replace,
$str);
static xmlspecialcharsback($str)
static __createFromDOM($domNode)
static CreateFromDOM($dom)
static xmlspecialcharsback($str)
static encodeValueLight( $name, $value)
setAttribute($attrName, $attrValue)
__construct($tag, $cdata=false)
static createTagAttributed($heavyTag, $value=null)
static xmlspecialchars($str)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
ShowError($strError, $cls="errortext")
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"