Wireshark-bugs: [Wireshark-bugs] [Bug 1110] Invalid characters in show attribute in PDML output

Date: Wed, 27 Sep 2006 19:06:36 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1110





------- Comment #13 from paul.blankenbaker@xxxxxxxxxx  2006-09-27 19:06 GMT -------
(In reply to comment #12)
> Change 19334 should fix this problem.  I no longer see problems with either of
> the pcap files attached to this bug.
> 
> The line in question from the tata.pcap export now reads:
> 
> <field name="tcp.analysis.duplicate_ack" showname="This is a TCP duplicate ack"
> size="0" pos="34" show="" value="""/>
> 
> I notice that there is a code path where the show attribute but not the value
> attribute will be written, and this happens for some of the fields from
> tata.pcap, e.g.
> 
> <field name="tcp.analysis.duplicate_ack_frame" showname="Duplicate to the ACK
> in frame: 1" size="0" pos="34" show="1"/>
> 
> This will be true of any "generated" field, where you can filter on the field
> "field == <value>", but no actual bytes are selected in the hex pane.  I don't
> think anyone has complained about this though.
> 
> 
> Please test and close this bug.
> 


I downloaded/built version "TShark 0.99.4-SVN-19334".

I do see the change you made. However, it still isn't legal XML. The issue is
that the 'value' attribute is set to:

  value="""

For a empty string, it should be:

  value=""

If the value is actually suppose to be 1 double quote character ("), a XML
escape sequence needs to be used. I think you need:

  value="&quot;"

The above seems to work with a trivial XML document:

<?xml version="1.0" ?>

<t value="&quot;" />

I can process the above with xsltproc and the following test XSL file:

<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
<xsl:output method="text" />

<xsl:template match="/">

  <!-- output "value=" -->
  <xsl:text>value=</xsl:text>

  <!-- display attribute value for t entity -->
  <xsl:value-of select="t/@value" />

  <!-- output a new line -->
  <xsl:text>
</xsl:text>

</xsl:template>

</xsl:stylesheet>

Gives me the results of:

[pkb@probe ~]$ xsltproc t.xsl t.xml
value="


Hope this helps.

Paul


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.