Click here to Skip to main content
13,550,613 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hey my understanding of XML is pretty much non-existent. I am trying to fix it so I am able to open it in Autodesk3DMax and edit the mesh. I keep getting the error 'Error at line 2, column 1: junk after document element'. If anyone could help me fix the code, or explain to me as simply as possible what is wrong I would be really grateful.

What I have tried:

The code is:
<MESH NUMSUBMESH="1"><SUBMESH NUMVERTICES="829" NUMFACES="859" NUMLODSTEPS="0" NUMSPRINGS="0" NUMMORPHS="0" NUMTEXCOORDS="1" MATERIAL="-2">
<VERTEX NUMINFLUENCES="1" ID="0">
<pos>51.6886 2.03197 1011.29
<norm>0.727597 0.395241 -0.560703
<color>0 0 0
<texcoord>0.231275 0.813344
<INFLUENCE ID="22">1
....
<FACE VERTEXID="662 827 825" />
<FACE VERTEXID="662 825 828" />
<FACE VERTEXID="646 662 828" />
</SUBMESH>
</MESH>
Posted 10-Nov-17 10:40am
Updated 11-Nov-17 20:52pm
v3
Comments
Graeme_Grant 10-Nov-17 18:05pm
   
Looking at the XML above, you are missing closing tags.
User-13482826 10-Nov-17 19:11pm
   
What are the closing tags <MESH NUMSUBMESH="1" />?
karthik2528 10-Nov-17 21:38pm
   
use  Reply   button to post comments/query to the concerned user, so that the user gets notified and respond to your text.
Dave-Kreskowiak 10-Nov-17 19:27pm
   
Unless you know the XML format for 3DMax, we have no idea what it's considering "junk".

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

<mesh numsubmesh="1">
  <submesh numvertices="829" numfaces="859" numlodsteps="0" numsprings="0" nummorphs="0" numtexcoords="1" material="-2">
    <vertex numinfluences="1" id="0"><!-- No matching closing tag -->
      <pos><!-- No matching closing tag -->
        51.6886 2.03197 1011.29
        <norm><!-- No matching closing tag -->
          0.727597 0.395241 -0.560703
          <color><!-- No matching closing tag -->
            0 0 0
            <texcoord><!-- No matching closing tag -->
              0.231275 0.813344
              <influence id="22"><!-- No matching closing tag -->
                1
                ....
                <face vertexid="662 827 825" />
                <face vertexid="662 825 828" />
                <face vertexid="646 662 828" />
              </submesh><!-- No matching opening tag -->
</mesh>

Looking at your XML nicly formatted always can help. Using a XML viewer tool even better...
You XML is full of problems of formatting - the question where it come from?
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web01-2016 | 2.8.180515.1 | Last Updated 12 Nov 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100