how can we handle XML commented tags portion?

46 views
Skip to first unread message

Pradeep Rathnayaka

unread,
Mar 31, 2013, 9:02:35 PM3/31/13
to protobuf-j...@googlegroups.com
I got an error when xml covert into proto message by using protobuf-java-format library . can you tell me how to handle commented tags portion in the xml files?

.................................................................
 /* Using XML file create a proto instance */
RouteGrant.Builder routGrant = RouteGrant.newBuilder();
XmlFormat.merge(sb.toString(), routGrant);
..............................................................

below is my error message.

<RouteGrant><command_ref>1234</command_ref><grant_id>2233</grant_id><!--  
  <begin_point>
    <route_id>321</route_id>
    <point>
      <x>10000.0</x>
      <y>8000.0</y>
      <orientation>0.5</orientation>
    </point>
  </begin_point>
  --><end_point><route_id>321</route_id><point><x>10000.0</x><y>9000.0</y><orientation>0.5</orientation></point></end_point></RouteGrant>
com.googlecode.protobuf.format.XmlFormat$ParseException: 1:70: Expected identifier. -!
at com.googlecode.protobuf.format.XmlFormat$Tokenizer.parseException(XmlFormat.java:668)
at com.googlecode.protobuf.format.XmlFormat$Tokenizer.consumeIdentifier(XmlFormat.java:494)
at com.googlecode.protobuf.format.XmlFormat.mergeField(XmlFormat.java:835)
at com.googlecode.protobuf.format.XmlFormat.merge(XmlFormat.java:774)
at com.googlecode.protobuf.format.XmlFormat.merge(XmlFormat.java:722)
at com.ads.funcs.RouteGrantXml2Proto.xml2Proto(RouteGrantXml2Proto.java:37)
at com.ads.funcs.RouteGrantXml2Proto.main(RouteGrantXml2Proto.java:82)

Reply all
Reply to author
Forward
0 new messages