【发布时间】:2011-04-18 09:01:39
【问题描述】:
使用 PHP 正则表达式我想从代码中提取一些值
<?xml version="1.0" encoding="UTF-8"?>
<xs:restriction base="xs:string">
<xs:enumeration value="001">
<xs:annotation>
<xs:documentation>Accountancy</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="002">
<xs:annotation>
<xs:documentation>Advertising</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="005">
<xs:annotation>
<xs:documentation>Amusement</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:schema>
我想从中提取值 001
<xs:enumeration value="001">
对于所有标签
和来自
的文本'Accountancy'<xs:documentation>Accountancy</xs:documentation>
使用 php reg ex 匹配
我该怎么做?
【问题讨论】:
-
使用 xml 解析器
-
由于这里的半列 xs:enu... 无法正常工作
-
它被称为命名空间,是的,它正在工作。
-
php xpath problems的可能重复