Opened 11 years ago

Closed 9 years ago

#11812 closed Bug Report - General (fixed)

Mythutil --pidprinter --xml output is NOT valid XML

Reported by: exegptxg5q@… Owned by: Karl Egly
Priority: minor Milestone: 0.28
Component: MythTV - DVB Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The output from mythutil --pidprinter --xml is not well formed for several reasons: 1) it does not have the leading <?xml> processing instruction. 2) It does not have a proper master node - if you dump several types of PSIP entry it will create each one at the top level, rather than as sub-nodes of the parent. 3) Nodes are not being properly XML escaped, so 3a) attributes are being created containing un-escaped quotes (example: <ProgramMapSection? pcr_pid="0x31" program_number="1"

program_info_length="17" stream_count="table_id="0x02" length="124" section="0" last_section="0""%8>

) 3b) Attributes can contain characters that need to be escaped in XML, such as < and & (example: <Decoded>Audio Stream Descriptor full_srv(1) sample_rate(48kbps) bit_rate(<=384kbps, 46)

bsid(8) bs_mode(0) channels(<= 6) Dolby(Not indicated) mainID(0) </Decoded>

Note the unescaped "<=384" in the XML. ) 4) Junk at the end of the ProgramMapSection? tag: (example: see above - note the %8> at the end of the tag.).

Change History (7)

comment:1 Changed 11 years ago by stuartm

Component: MythTV - GeneralMythTV - DVB
Milestone: 0.270.28
Owner: set to danielk

comment:2 Changed 10 years ago by Karl Egly

Owner: changed from danielk to Karl Egly
Status: newassigned

comment:3 Changed 10 years ago by Karl Dietz <dekarl@…>

In 37d9be84c43ac35fd533f1beab4cc7dec8ae6884/mythtv:

Add optional XML declaration to pidprinter

Refs #11812

comment:4 Changed 10 years ago by Karl Dietz <dekarl@…>

In a75c8566227e66089874b08f58695bb8bc95c97f/mythtv:

Add a root node to the XML output of the pidprinter

Refs #11812

comment:5 Changed 10 years ago by Karl Egly

Note to self: need to look into an issue with PrintOutput::Output when m_out is NULL. The LOG output does not make it to stdout which is confusing when testing. Using --outfile /dev/stdout works though. https://github.com/MythTV/mythtv/blob/master/mythtv/programs/mythutil/mpegutils.cpp#L422

comment:6 Changed 9 years ago by Karl Dietz <dekarl@…>

In 068047a5b43fffda91b08f3c0f6fb2651d9e3a85/mythtv:

add missing stream_count arg

fixes points 3a and 4 of the ticket

Refs #11812

comment:7 Changed 9 years ago by Karl Dietz <dekarl@…>

Resolution: fixed
Status: assignedclosed

In 5273d4364c96bfc5fd4fc651160e01334a90a343/mythtv:

escape xml special characters when printing decoded descriptors

fixes point 3b of the ticket

Fixes #11812

Note: See TracTickets for help on using tickets.