hassanakbar4 / tractive-test

0 stars 0 forks source link

<name> in <figure> is position dependent #357

Closed hassanakbar4 closed 2 years ago

hassanakbar4 commented 6 years ago

component_Version 2 cli resolution_worksforme type_defect | by miek@miek.nl


If I put name directly after figure I get (showing XML and text): xml

<figure>
<name>That's some nice code.
</name>
<artwork>println(&quot;some code&quot;)
</artwork>
</figure>

text

   println("some code")

                      Figure 1: That's some nice code.

Doing after the artwork:

<figure>
<artwork>println(&quot;some code&quot;)
</artwork>
<name>That's some nice code.
</name>
</figure>

renders:

   println("some code"): That's some nice code.

                                  Figure 1

Issue migrated from trac:357 at 2021-10-20 18:27:35 +0500

hassanakbar4 commented 6 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


Ok, I think you've found an undefined area in the v2v3 converter here.

FWIW, I think you'll have a smoother path forward with the v3 renderer if you generate v3-compliant xml. To see what your xml turns into before it hits the renderer, I'd suggest running any generated xml through the v2v3 converter. That will let you see if you're using non-v3 constructs (because the xml coming out is different from the xml going in).

hassanakbar4 commented 6 years ago

@{"email"=>"miek@miek.nl", "name"=>nil, "username"=>nil} commented


Fair enough, but shouldn't this be a XML validation error?

(my AST has the caption as the last child, so it's a bit tricky to print it first)

hassanakbar4 commented 6 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


Replying to hassanakbar4/tractive-test#357 (comment:2):

Fair enough, but shouldn't this be a XML validation error?

I just tried to reproduce this, and got (with mixed v2 and v3 input:

ERROR: Unable to validate the XML document:...
 <string>: Line 950: Element figure content does not follow the DTD, expecting (iref* , preamble? , artwork , postamble?), got (name artwork)
 <string>: Line 951: No declaration for element name
 <string>: Line 952: Element artwork was declared #PCDATA but contains non text nodes
 <string>: Line 953: No declaration for element name

With v3 input and on the artwork, I got:

   document.xml(0): Warning: Invalid document after running preptool: Did not expect element name there, line 1091

So this looks to me as if the construct does result in an XML validation error (or warning).

Did you not get any of these?

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} changed status from new to closed

hassanakbar4 commented 5 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} changed resolution from ` toworksforme`