[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

new msxml behaviour

  • From: Scott Cooper <scott@i...>
  • To: xml-dev@i...
  • Date: Wed, 05 Nov 1997 12:41:30 +1300

msxml getattribute
the new msxml contains this code within getText of ElementImpl which
changes the behaviour of entity expansions from the previous version:

for (Enumeration en = children.elements(); en.hasMoreElements(); )
{
	if (sb.length() > 0)
       	sb.append(' ');
       sb.append(((Element)en.nextElement()).getText());
}

return sb.toString();

notice the appending of a space. is this appropriate? it means constructs
like 'abc&SOME.ENTITY;def' expand to 'abc SOME.ENTITY.CONTENTS def' rather
than  'abcSOME.ENTITY.CONTENTSdef' like it used to which really stuffs my
application.

the last time i tried to 'improve' msxml the damn thing proved incredibly
difficult to recompile due to some ridiculuous circular dependancies among
the files - god knows how ms compiled it in the first place - anyway i now
see this awful dll rubbish in there so before i attempt to make a makefile
(*please* supply one next time ms :) ) is this in fact a problem? or should
i change my approach.

i was also wondering whether defaults for attributes should appear to the
application if the attribute isn't explicitly given in the markup. right
now i've added a function to traverse the tree and insert all attribute
defaults (if needed) before i start processing the document - what do you
think of that?

the msxml api was awful for getting schema information such as default
values. now it has a 'toSchema' function which returns an element with
child elements for each attribute. the child element's tag is 'ATTRIBUTE'
and it contains attributes such as 'XML:ID' containing the attribute name
and 'XML:DEFAULT' containing the default, for instance. this is an
incredibly convoluted method for accessing such information - are there any
other xml parsers out there that attach schema information to the markup
element itself - like element.getAttribute("xyz").getDefaultValue() rather
than
document.getElementDecl("abc").getChild("xyz").getAttribute("XML:DEFAULT").

finally (i've been saving up questions) i'd like this construct to be
parsed as a <bar> element...

<!ENTITY foo '<![CDATA[ 
  <bar>blah blah</bar>
]]>'>

...

&foo;

but instead, &foo; is processed as PCDATA (by msxml). is this correct
behaviour? section 4.4 of the xml ref contains the following: '6.For an
internal (text) entity, the processor must include the entity; that is,
retrieve its replacement text and process it as a part of the document
(i.e. as content or AttValue, whichever was being processed when the
reference was recognized), passing the result to the application in place
of the reference. The replacement text may contain both text and markup,
which must be recognized in the usual way...'
     
well i haven't received any messages from the list today (maybe you're all
in bed on US time) so how about chewing on that for me 'cos i must say it's
a pain to rewrite your code when you had to hack it in the first place to
work.

p.s. i'm using xml to define the syntax and byte data of a peer-to-peer
network interaction over pacnet and there aren't any PIs. if anyone would
like to check out what i've done i'd greatly appreciate any opinions.
---------------------------------------------------------------------
Iguana Information Services 		Ph    +64 4 499 9782
PO Box 10 609				Fax   +64 4 499 4439
Wellington				Email scott@i...
New Zealand				HTTP  http://www.iguana.co.nz

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.