Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/118.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
Android 使用XSL从XML读取图像URL以在web浏览器中显示网页_Android_Ios_Xml_Image_Xslt - Fatal编程技术网

Android 使用XSL从XML读取图像URL以在web浏览器中显示网页

Android 使用XSL从XML读取图像URL以在web浏览器中显示网页,android,ios,xml,image,xslt,Android,Ios,Xml,Image,Xslt,我正在使用xsl格式化xml文件。其中一部分涉及从XML文件读取图像URL,然后在web浏览器中显示图像。我尝试过两种不同的方法,在windows机器上使用firefox、Internet Explorer或Edge查看时,这两种方法都有效 当我尝试在iphone上使用Safari或Firefox(使用IOS 10)查看此文档时,除了没有显示图像外,文档显示正确。我也在安卓手机上试用过,结果相同——没有显示图像。我的问题是,这可以在IOS(或Android)手机网络浏览器上实现吗 下面是源xml

我正在使用xsl格式化xml文件。其中一部分涉及从XML文件读取图像URL,然后在web浏览器中显示图像。我尝试过两种不同的方法,在windows机器上使用firefox、Internet Explorer或Edge查看时,这两种方法都有效

当我尝试在iphone上使用Safari或Firefox(使用IOS 10)查看此文档时,除了没有显示图像外,文档显示正确。我也在安卓手机上试用过,结果相同——没有显示图像。我的问题是,这可以在IOS(或Android)手机网络浏览器上实现吗

下面是源xml文件(删除了与图像无关的标记)


霍布森选择
../images/show_images/hobsons_choice/hobsons_choice.jpg
霍布森选择
... 这里有更多的标签
... 这里有更多的标签
用于格式化已删除节的文档的XSL文件:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="show_details">

    <html>
....
<xsl:element name="img">
  <xsl:attribute name="class">
    show_images
  </xsl:attribute>
  <xsl:attribute name="alt">
    <xsl:value-of select="show_image/image_alt_text"/>
  </xsl:attribute>
  <xsl:attribute name="src">
    <xsl:value-of select="show_image/image_path"/>
  </xsl:attribute>
</xsl:element>
....More HTML
</html> 
</xsl:template>
</xsl:stylesheet>

....
显示图片
…更多HTML
我还尝试使用以下方法简单插入图像:

<img src="{show_image/image_path}"/>


这两种方法似乎都不适用于IOS或Android手机。

这不是一个真正的编程问题,是吗?来自
show\u details
上下文节点的url的完整xpath将是
production/show\u image/image\u path
,您可能希望将
空间规范化(production/show\u image/image\u path)
关于它谢谢Stefan,你建议添加
normalize-space()
似乎就是答案。这不是一个真正的编程问题,不是吗?来自
show\u details
上下文节点的url的完整xpath将是
production/show\u image/image\u path
,你可能想把
normalize space(制作/显示图像/图像路径)
围绕它谢谢你Stefan,你建议添加
normalize-space()
似乎就是答案。
<img src="{show_image/image_path}"/>