0

伙计们,我的 xml 在一个字符串中,我正在尝试将 xml 加载到字符串中,它向我显示错误。我正在尝试将字符串中的 xml 文档加载到 xmldocument 对象,但它显示以下错误:

'=' 字符,十六进制值 0x3D,不能包含在名称中。第 10 行,第 27 位。

我的 xml 在这样的字符串变量中:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<OTA_AirLowFareSearchRQ EchoToken="0" SequenceNmbr="0" TransactionIdentifier="0" AvailableFlightsOnly="" DirectFlightsOnly="" xmlns="http://www.opentravel.org/OTA/2003/05">
<POS xmlns="http://www.opentravel.org/OTA/2003/05">
<Source AgentSine="" PseudoCityCode="" TerminalID="1">
<RequestorID ID="AFFILIATE"/>
</Source>
<YatraRequests>
<YatraRequestDoNotHitCache="false" DoNotCache="false" YatraRequestTypeCode="SMPA" Description="" MidOfficeAgentID="28737" AffiliateID="TRAVELPARTNER" />
</YatraRequests>
</POS>
<TravelerInfoSummary>
<AirTravelerAvail>
<PassengerTypeQuantity Code="ADT" Quantity="1"/>
<PassengerTypeQuantity Code="CHD" Quantity="2"/>
<PassengerTypeQuantity Code="INF" Quantity="1"/>
</AirTravelerAvail>
</TravelerInfoSummary>
<SpecificFlightInfo>
<Airline Code=""/>
</SpecificFlightInfo>
<OriginDestinationInformation>
<DepartureDateTime>30/01/2013</DepartureDateTime>
<OriginLocation CodeContext="IATA" LocationCode=BLR>BLR</OriginLocation>
<DestinationLocation CodeContext="IATA" LocationCode=DEL>DEL</DestinationLocation>
</OriginDestinationInformation>
<TravelPreferences>
<VendorPref Code="SG"/>
<VendorPref Code="DN"/>
<CabinPref Cabin=Economy/>
</TravelPreferences>
</OTA_AirLowFareSearchRQ>
</soapenv:Body>
</soapenv:Envelope>
4

1 回答 1

1

正如错误明确指出的那样,您的 XML 无效:

<YatraRequestDoNotHitCache="false" 
于 2013-01-18T18:05:44.553 回答