![](/img/trans.png)
[英]Still confused on ConfigureAwait(false) used with GetAwaiter and GetResult in C#. Getting a deadlock or method not returning
[英]XSOM parser getResult returning null
我正在嘗試解析XSD文件。 解析器的parse方法沒有給出任何異常,但是當我使用parser.getResult()
,它返回null
。 我的XSD文件中有一個Schema節點。
XSOMParser parser = new XSOMParser();
parser.parse(new File(schemaPath)); //This runs fine
this.schemaSet = parser.getResult(); //here I get A null
有任何想法嗎?
XSOMParser :: getResult()的Javadoc指出,如果存在解析錯誤,它將返回null。 如果您的架構僅包含<xsd:schema />,而您的解析器版本卻為空,那么我將其稱為實現中的錯誤(空架構是有效架構)。 如果沒有,那么我將明確地附加一個錯誤處理程序,以確保沒有其他問題在起作用。 最有可能是出問題了。
首先嘗試使用某種XML模式驗證工具來驗證XSD文件。 如果您的架構引用了外部架構,請確保在您的外部引用使用相對URI的情況下指定系統ID。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.