≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Parsing Problem
Posted by:
(you are not logged in)
Enter the missing letter in: "Inter?ational"
(you are not logged in)
Text:
[quote][b]Lord Nyson[/b] wrote: Hey there guys, i'm having a bit of trouble, probably stemming from the fact that my coding is rudamentary :)
[b]XML Document[/b]
[code]
<?xml version="1.0"?>
<data>
<PositionX x='0' />
<PositionY y='-200' />
<PositionZ z='0' />
<ScalingX x='0.4' />
<ScalingY y='0.4' />
<ScalingZ z='0.4' />
<CenterX x='0' />
<CenterY y='0' />
<CenterZ z='0' />
<Radius x='1000' />
<Speed x='200' />
<Direction x='0' />
</data>
[/code]
[b]Coding[/b]
[code]
fileName.append(".xml");
IrrXMLReader* reader = createIrrXMLReader(fileName.c_str());
// parse the file until end reached
while(reader->read())
{
if (!strcmp("PositionX", reader->getNodeName()))
posX = reader->getAttributeValueAsFloat("x");
else
if (!strcmp("ScalingX", reader->getNodeName()))
scaleX = reader->getAttributeValueAsFloat("x");
else
if (!strcmp("CenterX", reader->getNodeName()))
rotationCenterX = reader->getAttributeValueAsFloat("x");
else
if (!strcmp("PositionY", reader->getNodeName()))
posY = reader->getAttributeValueAsFloat("y");
else
if (!strcmp("ScalingY", reader->getNodeName()))
scaleY = reader->getAttributeValueAsFloat("y");
else
if (!strcmp("CenterY", reader->getNodeName()))
rotationCenterY = reader->getAttributeValueAsFloat("y");
else
if (!strcmp("PositionZ", reader->getNodeName()))
posZ = reader->getAttributeValueAsFloat("z");
else
if (!strcmp("ScalingZ", reader->getNodeName()))
scaleZ = reader->getAttributeValueAsFloat("z");
else
if (!strcmp("CenterZ", reader->getNodeName()))
rotationCenterZ = reader->getAttributeValueAsFloat("z");
else
if (!strcmp("Radius", reader->getNodeName()))
radius = reader->getAttributeValueAsFloat("x");
else
if (!strcmp("Speed", reader->getNodeName()))
speed = reader->getAttributeValueAsFloat("x");
else
if (!strcmp("Direction", reader->getNodeName()))
direction = reader->getAttributeValueAsFloat("x");
break;
};
// delete the xml parser after usage
delete reader;[/code]
It appears to read all values at 0. But then again I do have within my code settings to 0 within my constr[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact