It is my opinion that if you already know the names of your attributes, it would be more efficient to just walk the attribute list ONCE and keep picking out the attributes you encounter.
of course you are right but in my case the XML file is small.
There are only 4 attribute lists defined in the DT
Is there a way for me to validate the DOM content while building.
Essentially I am interested in element and attribute content only. Does the
value for the elements adhere to the schema. Things like default
values/restrictive datatypes etc. Is there anyway I could get to a
XMLElementDecl and call a
I do not know how you intend to use the getAttribute fn in your application. But just
a tip.
each call to getAttribute (when u want to get attrib by name) causes many
searches/traversals/string-comparisons etc to happen. Internally, the implementation
uses binary search, but still, multiple str
XMLCh* attrName = XMLString::transcode(attributeName);
attrVal = nodeElement->getAttribute(attrName);
delete [] attrName;
Yep. Now it´s perfect.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comma
Not quite. This line:
attrVal =
nodeElement->getAttribute(XMLString::transcode(attributeName));
has a memory leak.
XMLCh* attrName = XMLString::transcode(attributeName);
attrVal = nodeElement->getAttribute(attrName);
delete [] attrName;
Dave
wow ! we are all really very glad that it worked for you :-)
please do not put me in the mail filter already! :)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
wow ! we are all really very glad that it worked for you :-)
> -Original Message-
> From: Andreas B. Thun [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 24, 2003 11:26 AM
> To: [EMAIL PROTECTED]
> Subject: Re: parsing DOM tree: How to get attribute values ( I don´t
> like mondays)
>
>
>
it works!!
finally, here is the proper code for the archive:
// ---
// printAttributeValue
// ---
static void printAttributeValue(DOMNode *node, char *at
At 16.55 24/03/2003 +0100, you wrote:
The C++ syntax for static cast is static_cast(node)
Good try. Unfortunately it has not helped. :-/
Time to get drunk...
I think so; has the following code been written *after* my e-mail? I still
see the parenthesis "()" instead of the angle brackets "<>" arou
$i?
Well, anyways, just an update. I modified the class to set a value to those
categories and now I don't get the error. Maybe it's something with BCB.
-Original Message-
From: Gareth Reakes [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 2:14 AM
To: [EMAIL PROTECTED]
Subject: R
The C++ syntax for static cast is static_cast(node)
AAAHH! I see! < not ( !!!
...bloody C...
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
The C++ syntax for static cast is static_cast(node)
Good try. Unfortunately it has not helped. :-/
Time to get drunk...
// ---
// printAttributeValue
// --
I am attaching the new domcount file for your convenience.
Thank you. In DOMCount, getAttributes() is used.
IMHO to retrieve the attribute by name I must use getAttribute().
?! Do I?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
sorry about that. I believed that the new sample got checked in a few days back...
I am attaching the new domcount file for your convenience.
-Vinayak
> -Original Message-
> From: Andreas B. Thun [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 24, 2003 10:30 AM
> To: [EMAIL PROTECTED]
>
At 16.26 24/03/2003 +0100, you wrote:
[...]
nodeElement = static_cast(DOMElement *) (node); // what is the
problem?
The C++ syntax for static cast is static_cast(node)
Alberto
-
To unsubscribe, e-mail: [EMAIL PROTECTED
you may want to take a look at the new DomCount.cpp file. This comes with the samples. I believe it has an example of accessing and using attributes.
scanned all examples. No getAttribute found
-
To unsubscribe, e-mail: [EMAIL
you may want to take a look at the new DomCount.cpp file. This comes with the samples.
I believe it has an example of accessing and using attributes.
-Vinayak
> -Original Message-
> From: Andreas B. Thun [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 24, 2003 10:26 AM
> To: [EMAIL PROTE
printAttributeValue(typeChild->getFirstChild(), "min");
Thx. That helped a lot. In my opinion the first child of ElementLength
was the attribute min.
And by the way, getFirstChild() returns a DOMNode* which doesn't have the
getAttribute method. You need to cast it to an DOMElement*, see below.
Yo
You mentioned that the problem occurs when you compile release code. When
you build release code, link only to release libraries (Xerces, compiler
runtimes, etc). When you build debug code, link only to debug libraries. If
you're building release code and linking to the debug version of Xerces
and/
i read the faq and it says only that I must use Multithreaded DLL and debug
Multithreaded DLL.
I'm using that configuration.
Is there any api function as XMLString::release in xerces 2.1?
- Original Message -
From: "Jesse Pelton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, Ma
Title: RE: nillable element with default values
So, nobody with a good answer for me?
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 19, 2003 1:34 PM
To: [EMAIL PROTECTED]
Subject: nillable element with default values
I am wondering if
I'd wager you're running on Windows and mixing runtime library versions.
Check the FAQ.
-Original Message-
From: Iggeres [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 7:59 AM
To: [EMAIL PROTECTED]
Subject: Re: Question
I'm using xercesc 2.1 and XMLString::release doesn't exist.
Wait a minute.. I did answer the wrong question here, didn't I?
The method getAttribute is a member of the DOMElement.
http://xml.apache.org/xerces-c/apiDocs/classDOMElement.html
virtual const XMLCh * getAttribute (const XMLCh *name) const=0
Retrieves an attribute value by name.
But I found
Oh THAT! :)
Just cast your DOMNode* to a DOMElement*. If you are paranoid then you can
do a check that the node really is an element.
DOMElement poElement = NULL;
if (poNode->getType() == ELEMENT_NODE)
poElement = static_cast(poNode);
Regards
Erik Rydgren
Mandarinen systems AB
Sweden
-O
I'm using xercesc 2.1 and XMLString::release doesn't exist.
What api function I must use?
I saw some sample programs in the distribution and they use delete.
- Original Message -
From: "Vitaly Prapirny" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 23, 2003 8:02 AM
Subje
Thx, Erik and Parul but ...
how can I get the element? I selected the right node (ElementLength)
but I cannot compile this because getAttribute is not a member of
the DOMElement class.
I tried getAttributeNode, but it doesn´t work, either...
Jeez. I am completely stuck now. No ideas any more...
May
Hey,
Alby is of course right, far to early in the morning for me.
Gareth
On Mon, 24 Mar 2003, Alberto Massari wrote:
> At 09.07 24/03/2003 +, Gareth Reakes wrote:
> >Hi,
> > a SOAP message is just a piece of XML so you would validate like
> >any other document. Several
Thx, Erik and Paul but ...
how can I get the element? I selected the right node (ElementLength)
but I cannot compile this because getAttribute is not a member of
the DOMElement class.
I tried getAttributeNode, but it doesn´t work, either...
// ---
I'm not sure about this but following code will help u out
// temp is the pointer to ElementLength element in your xml. So if it not a
very first elemnt //trace down till the lement whose attribute u want to get
/*here with this code if u will print the value of temp by usin
DOMNode *temp = eleme
Yes this is the function you would use to retreive attribute values and it
should look something like this.
cElement* poElementLength = poParent->getFirstChild(); // or something that
retrives the correct element
const char* pzMin =
XMLString::transcode(poElementLength->getAttribute("min"));
const
No it obviously is not
How can I retrieve the values by name?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi,
I want to get attribute values of "min" and "max" (see below)
and found this code: Is this the proper sulution for me?
const XMLCh * DOMElementImpl::getAttribute(const XMLCh *nam) const
{
static const XMLCh emptyString[] = {0};
DOMNode * attr=0;
attr=fAttributes->getNamedItem(nam)
At 09.07 24/03/2003 +, Gareth Reakes wrote:
Hi,
a SOAP message is just a piece of XML so you would validate like
any other document. Several of the sample programs will do this. After
building them something like
DOMPrint xmlfile xmlschema
will work
I am not an expert of SOAP messages,
At 15.14 22/03/2003 +, Mark Weaver wrote:
From an EntityResolver, I can't see anyway of getting the base URI of the
URI that is passed in for resolution. In some instances I can store it
(e.g. I can do this for the document), but if the document references a
DTD which has imports, then I ca
Hi,
>
> I'm pretty sure that Category has not been set on this one. Would that be
> the reason for this error?
No, XMLString::transcode can handle null values. Are you sure that $i is
not null?
Gareth
--
Gareth Reakes, Head of Product Development +44-1865-203192
DecisionSoft Limited
Hi,
a SOAP message is just a piece of XML so you would validate like
any other document. Several of the sample programs will do this. After
building them something like
DOMPrint xmlfile xmlschema
will work
Gareth
On Fri, 21 Mar 2003, Kevin Zhang wrote:
> Hello,
>
> I'm new to xerc
36 matches
Mail list logo