Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > XML valueless parameters?

Reply
Thread Tools

XML valueless parameters?

 
 
lbrtchx@gmail.com
Guest
Posts: n/a
 
      04-09-2009
I was wondering what the method getValue(int) of SAX2 Attributes
returns if the parameter is just flag, something like:
~
<par conf="0" do />
~
instead of
~
<par conf="0" do="true|false" />
~
this is what the method def. says:
~
http://java.sun.com/webservices/docs...l#getValue(int)
Look up an attribute's value by index.
If the attribute value is a list of tokens (IDREFS, ENTITIES, or
NMTOKENS), the tokens will be concatenated into a single string with
each token separated by a single space.
Parameters: index - The attribute index (zero-based).
Returns: The attribute's value as a string, or null if the index is
out of range.
~
Thanks
lbrtchx
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      04-10-2009
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I was wondering what the method getValue(int) of SAX2 Attributes
> returns if the parameter is just flag, something like:
> ~
> <par conf="0" do />


This is not well-formed XML and should be rejected outright by the parser.
<http://www.w3.org/TR/REC-xml/#sec-starttags>
<http://www.w3.org/TR/REC-xml/#dt-attr>

--
Lew
 
Reply With Quote
 
 
 
 
Mike Schilling
Guest
Posts: n/a
 
      04-10-2009
Lew wrote:
> (E-Mail Removed) wrote:
>> I was wondering what the method getValue(int) of SAX2 Attributes
>> returns if the parameter is just flag, something like:
>> ~
>> <par conf="0" do />

>
> This is not well-formed XML and should be rejected outright by the
> parser. <http://www.w3.org/TR/REC-xml/#sec-starttags>
> <http://www.w3.org/TR/REC-xml/#dt-attr>


What Lew said. The closest you can come that's well-formed is

<par config="" />

Which returns an empty string, not null, in case there was any question.


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      04-10-2009
On Apr 10, 10:09 am, Lew <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > I was wondering what the method getValue(int) of SAX2 Attributes
> > returns if the parameter is just flag, something like:
> > ~
> > <par conf="0" do />

>
> This is not well-formed XML ..


You can check the well-formedness of your XML in the XMLWFC.
<http://pscode.org/xml/xmltools.html#xmlwfc>

--
Andrew T.
pscode.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM
embedding xml in xml as non-xml :) Mark Van Orman XML 5 09-15-2004 05:57 AM
What XML technologies to learn first for "XML Processing" and "XML Mapping"? Bomb Diggy Java 0 07-28-2004 07:26 AM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments