XMLNode

버전 1.6.0.1 (14.9 KB) 작성자: Jarrod Rivituso
MATLAB class that allows you to use XPath to navigate and extract data from an XML document.
다운로드 수: 1.6K
업데이트 날짜: 2016/9/1

라이선스 보기

Using XMLNode, you can read an XML document into MATLAB as an XMLNode object. This object allows you to navigate and extract data from the XML document using XPath queries.
For example, in the XML document of colors (colors.xml)
<colors>
<color>
<name>red</name>
<hex>FF0000</hex>
</color>
<color>
<name>green</name>
<hex>00FF00</hex>
</color>
<color>
<name>blue</name>
<hex>0000FF</hex>
</color>
</colors>
you could obtain the green hex node using
>> n = XMLNode('colors.xml')
>> n.colors.color(2).hex

or

>> n = XMLNode('colors.xml')
>> n('colors/color[2]/hex')

To extract traditional MATLAB arrays instead of returning XMLNode objects, use {} indexing.

>> n = XMLNode('colors.xml')
>> greenHex = n{'colors/color[2]/hex'}

Supports namespaces and various character encodings.

If you have enhancement suggestions or if you find a bug, please leave a comment :)

인용 양식

Jarrod Rivituso (2024). XMLNode (https://www.mathworks.com/matlabcentral/fileexchange/34711-xmlnode), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Structured Data and XML Documents에 대해 자세히 알아보기
도움

줌: Gating-ML

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.6.0.1

Updated license

1.6.0.0

Setting the toolbox flag

1.5.0.0

Fixed copyright statements

1.3.0.0

Updates made based on user comments...

- Empty array now returned when XPath expression is not found in document
- Created an "addNamespacePrefix" method
- Updated command window display

1.0.0.0