Re: [xml] recursive entities

Hi Scott,

  I frequently get "burned" making guesses about what's happening,
but let me give it try anyway.  I'm assuming you have your own
program making calls to the library, and that you are not talking
about using one of the library utility programs such as xmllint.

  Let's begin by noting that Liam Quin's post showed that xmllint
works just fine, so it must be something which that program does
and your code does not do.  Next let's note that he used the
'--noent' flag.  What does that do?  Answer - it sets the
XML_PARSE_NOENT flag (I *love* open source projects, where you can
look at how other programs work).  So, my first guess would have
to be that you are not setting that flag when calling whatever API
routine you are using to parse the file (refer to the docs for
details about what this flag does).  Could that possibly be it?


Scott Murman said:
ok, let's take this further, because i'm definitely not getting the
right functionality.  i'm using libxml2-2.6.2.  if i use the entity
defs below, then define an element as

<Foo Name="example">
     <Bar Init="&Height;" />

this will expand so that Init = "2.0 * &Alt;", not Init = "2.0 *
any clues what i'm doing wrong?


our group would like to use recursive entity definitions, i.e.

<!DOCTYPE Scenario SYSTEM "Scenario.dtd" [
     <!ENTITY Alt "1.0">
     <!ENTITY Height "2.0 * &Alt;">

works fine for me with, e.g. xmllint --noent filename.xml

(version here is libxml2-2.6.6-1mdk)

  Yeah, I doubt such a breakage would go unnoticed though the
regression tests.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]