Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8291195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:02:43+00:00 2026-06-08T13:02:43+00:00

Here is a XML: <mesh> <triangles material=face count=990> <input semantic=VERTEX source=#boyShape-skin-vertices offset=0/> <input semantic=NORMAL

  • 0

Here is a XML:

<mesh>

  <triangles material="face" count="990">
          <input semantic="VERTEX" source="#boyShape-skin-vertices" offset="0"/>
          <input semantic="NORMAL" source="#boyShape-skin-normals" offset="1"/>
          <input semantic="TEXCOORD" source="#boyShape-skin-map-channel1" offset="2" set="1"/>
          <p>45 56 44 61 57 45 58 58 46 58 58 46 65 59 47 45 56 44 46 60 48 67 61 49 58 58 46 58 58 46 61 57 45 46 60 48 49 62 50 66 63 51 </p>
  </triangles>
  <triangles material="face" count="1320">
          <input semantic="VERTEX" source="#boyShape-skin-vertices" offset="0"/>
          <input semantic="NORMAL" source="#boyShape-skin-normals" offset="1"/>
          <input semantic="TEXCOORD" source="#boyShape-skin-map-channel1" offset="2" set="1"/>
          <p>45 46 60 48 49 62 50 66 63 51 45 56 44 61 57 45 58 58 46 58 58 46 65 59 47 45 56 44 46 60 48 67 61 49 58 58 46 58 58 46 61 57 45 46 60 48 49 62 50 66 63 51 </p>
  </triangles>
  <triangles material="face" count="1540">
          <input semantic="VERTEX" source="#boyShape-skin-vertices" offset="0"/>
          <input semantic="NORMAL" source="#boyShape-skin-normals" offset="1"/>
          <input semantic="TEXCOORD" source="#boyShape-skin-map-channel1" offset="2" set="1"/>
          <p>58 46 58 58 46 65 59 47 45 56 44 61 57 45 58 58 46 58 58 46 65 59 47 45 56 44 46 60 48 67 61 49 58 58 46 58 58 46 61 57 45 46 60 48 49 62 50 66 63 51 </p>
  </triangles> 
  </mesh>

Java code is

for(int s=0; s<mesh.getLength() ; s++){
    Node firstPersonNode = mesh.item(s);
    System.out.println(mesh.item(s).getNodeName() + " Test");
    if(firstPersonNode.getNodeType() == Node.ELEMENT_NODE){
        Element firstPersonElement = (Element)firstPersonNode;
        NodeList source = firstPersonElement.getElementsByTagName("triangles");    
        System.out.println(source.getLength() + "Source Length");
        Node firstsource = source.item(1); // triangles index given here
        if(firstsource.getNodeType() == Node.ELEMENT_NODE){
            Element firstPersonElement1 = (Element)firstsource;
            System.out.println(firstPersonElement1.getAttribute("id") + " -->  <-- ");
            NodeList floatarray = firstPersonElement1.getElementsByTagName("p");
            Element firstNameElement = (Element)floatarray.item(0);
            NodeList textFNList = firstNameElement.getChildNodes();
            System.out.println("Vertexes : " + ((Node)textFNList.item(0)).getNodeValue().trim());  
        }
    }
}

I am trying to parse the input and p which lies inside triangles node but, I have a problem.
The problem is when I specify the index as 1 in the above mentioned code all the child nodes are getting detected and gets parsed. other than 1 it doesn’t even detect the child nodes input and p. What may be the problem? Please help me to resolve this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:02:44+00:00Added an answer on June 8, 2026 at 1:02 pm

    Here is how you can parse your document using the DOM API:

        NodeList triangles = document.getElementsByTagName("triangles");
        System.out.println("triangles: " + triangles.getLength());
    
        for (int i = 0; i < triangles.getLength(); i++) {
            Element triangle = (Element) triangles.item(i);
            System.out.println("triangle: material=" + triangle.getAttribute("material") + " count=" + triangle.getAttribute("count"));
    
            NodeList inputs = triangle.getElementsByTagName("input");
            for (int j = 0; j < triangles.getLength(); j++) {
                Element input = (Element) inputs.item(j);
                System.out.println("  input: semantic=" + input.getAttribute("semantic"));
            }
    
            Element vertices = (Element) triangle.getElementsByTagName("p").item(0);
            System.out.println("  vertices: " + vertices.getTextContent().trim());
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With glassfish, my persistence.xml is not loaded. my.ear META-INF/persistence.xml lib/entities.jar <!-- no persistence.xml here
Here is my XML: <section> <para>part1 <breakline/> part2 <list> <para>list1 </para> <para>list2 </para> </list>
Here is my XML Response: <DIDL-Lite xmlns=urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/ xmlns:dc=http://purl.org/dc/elements/1.1/ xmlns:upnp=urn:schemas-upnp-org:metadata-1-0/upnp/ <item id=1182 parentID=40 restricted=1> <title>Hot
here is my xml DOM. <entities> <entity id=7006276> <title>xxx</title> <entities> <entity id=7877579> <title>xxx</title> <entities>
Here is my XML: [link]=> array(2) { [0]=> object(SimpleXMLElement)#244 (1) { [@attributes]=> array(3) {
Here's the XML: <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <feed xmlns=http://www.w3.org/2005/Atom xmlns:dc=http://purl.org/dc/elements/1.1/> <title>Rated Images</title> <link
here is the XML file : <com.google.android.maps.MapView android:layout_width=fill_parent android:layout_height=fill_parent android:apiKey=0q7NUYm4bgzeXlqXtKYVPJDRWUJmt8Cu0gvbWMx android:id=@+id/map_view /> and Manifest
here is the xml data : <root> <recommendedMaterials> <value label=Aluminium data=0 /> <value label=Iron
I am new to xml and android programming.Here is my xml code... I don't
I'm trying to learn some XML Parsing here and I've been given some code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.