Оценка XPath "// element [@ name = 'startTime']" приводит к пустому целевому узлу - PullRequest
0 голосов
/ 24 октября 2018

Я пробовал разные вещи, но не смог решить проблему.Содержимое файла VoIP3.5-A.0-short.xsd

   <?xml version="1.0" encoding="UTF-8"?>
   <!--Generated by Turbo XML 2.4.1.100. Conforms to w3c 
    http://www.w3.org/2001/XMLSchema-->
   <schema xmlns="http://www.w3.org/2001/XMLSchema" 
       targetNamespace="http://www.ipdr.org/namespaces/VoIP">
        <element name="subscriberID" type="string"/>
        <element name="hostName" type="string"/>
        <element name="ipAddress" type="string"/>
        <element name="startTime" type="string"/>
        <element name="endTime" type="string"/>
        <element name="timeZoneOffset" type="integer"/>
        <element name="callCompletionCode" type="string"/>
        <element name="originalDestinationId" type="string"/>
    </schema>

Файл привязки VoIP3.5-A.0.xjb

<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns="http://www.w3.org/2001/XMLSchema"
       xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="1.0">
  <jaxb:bindings schemaLocation="VoIP3.5-A.0-short.xsd">
    <jaxb:bindings node="//element[@name='startTime']">
      <jaxb:class name="VoIPStartTime"/>
    </jaxb:bindings>
  </jaxb:bindings>
</jaxb:bindings>

Среда: Java 1.8.0_181xjc 2.2.8-b130911.1802

xjc -d tmp  -b .\VoIP3.5-A.0.xjb .\VoIP3.5-A.0-short.xsd
parsing a schema...
[ERROR] XPath evaluation of "//element[@name='startTime']" results in empty target node
  line 5 of file:/C:/DevWorkSpace/gs-correlator/src/main/resources/VoIP3.5-A.0.xjb

Failed to parse a schema.
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...