Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/248.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
xml编码在php页面中注册为字符串_Php_Xml - Fatal编程技术网

xml编码在php页面中注册为字符串

xml编码在php页面中注册为字符串,php,xml,Php,Xml,我有一个带有javascript函数的.php页面,该页面加载XML数据以打印条形码,但是当我定义XML时 <?xml version="1.0" encoding="utf-8?> 您必须运行标题(“内容类型:text/xml”)否则浏览器将不知道您正在发送xml。如果这不起作用,我还可以尝试查看字符串中的?>,因为这总是会混淆PHP。试试'?'.>'或者类似的方法。好的,没有?>和just>的话,它似乎可以正常工作。 var labelXml = '<?xml ve

我有一个带有javascript函数的.php页面,该页面加载XML数据以打印条形码,但是当我定义XML时

 <?xml version="1.0" encoding="utf-8?>

您必须运行
标题(“内容类型:text/xml”)否则浏览器将不知道您正在发送xml。如果这不起作用,我还可以尝试查看字符串中的
?>
,因为这总是会混淆PHP。试试
'?'.>'
或者类似的方法。好的,没有?>和just>的话,它似乎可以正常工作。
  var labelXml = '<?xml version="1.0" encoding="utf-8"?>\
            <DieCutLabel Version="8.0" Units="twips">\
            <PaperOrientation>Landscape</PaperOrientation>\
            <Id>Address</Id>\
            <PaperName>30252 Address</PaperName>\
            <DrawCommands>\
            <RoundRectangle X="0" Y="0" Width="1581" Height="5040" Rx="270" Ry="270"/>\
            </DrawCommands>\
            <ObjectInfo>\
            <BarcodeObject>\
            <Name>BARCODE</Name>\
            <ForeColor Alpha="255" Red="0" Green="0" Blue="0"/>\
            <BackColor Alpha="255" Red="255" Green="255" Blue="255"/>\
            <LinkedObjectName></LinkedObjectName>\
            <Rotation>Rotation0</Rotation>\
            <IsMirrored>False</IsMirrored>\
            <IsVariable>False</IsVariable>\
            <Text>*E200001*</Text>\
            <Type>Code39</Type>\
            <Size>Medium</Size>\
            <TextPosition>Bottom</TextPosition>\
            <TextFont Family="Lucida Grande" Size="10" Bold="False" Italic="False" Underline="False" Strikeout="False"/>\
            <CheckSumFont Family="Lucida Grande" Size="10" Bold="False" Italic="False" Underline="False" Strikeout="False"/>\
            <TextEmbedding>None</TextEmbedding>\
            <ECLevel>0</ECLevel>\
            <HorizontalAlignment>Center</HorizontalAlignment>\
            <QuietZonesPadding Left="0" Right="0" Top="0" Bottom="0"/>\
            </BarcodeObject>\
            <Bounds X="331.2" Y="328.0469" Width="4455.625" Height="1044.844"/>\
            </ObjectInfo>\
            </DieCutLabel>';