本文介绍了QT:XML解析XPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将通过QT XML库解析单词文档,然后我希望使用xpath表达式来完成它。 但QT XQuery效果不佳。 这是我要解析的xml文件。
Hi, I'm going to parse the word document by QT XML library and then I hope use the xpath expressions to do it. But QT XQuery doesn't works well. Here is xml file I want to parse.
<?xml version="1.0" encoding="UTF-8"?> <Types xmlns="schemas.openxmlformats/package/2006/content-types"> <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/> <Default Extension="xml" ContentType="application/xml"/> <Default Extension="jpg" ContentType="image/jpeg"/> <Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/> <Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/> <Override PartName="/word/stylesWithEffects.xml" ContentType="application/vnd.ms-word.stylesWithEffects+xml"/> <Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/> <Override PartName="/word/webSettings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"/> <Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/> <Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/> <Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/> <Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/> </Types>我按照以下方式制作了xq文件。我根据qt examples / recipes创建了它。 但是它没有解析XML文件。所以我将我的文件移动到qt examples / recipes但它也失败了。
And I made the xq file as follows. I made it according the qt examples/recipes. But it doesn't parse the XML file. So I move my files to qt examples/recipes but it also failed.
(: Get Parts From :) declare variable $inputDocument external; doc($inputDocument)/Types/Override我很感激你的帮助...
I appreciate your helps...
推荐答案inputDocument external; doc( inputDocument external; doc(
inputDocument )/类型/覆盖 inputDocument)/Types/Override
感谢您的帮助...
I appreciate your helps...
更多推荐
QT:XML解析XPath
发布评论