473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Parameter-entity inclusion in mark-up declarations

Hello,

If an XML processor encounters a 'PEReference' in a 'markupdecl' (but
not in 'EntityValue'), are there circumstances where it does not have to
include it (i.e. use the replacement text and re-parse), e.g. when not
validating? Or perhaps it would never have to have such an encounter
unless it was already required to include?

If it does not include, what can it assume about the subsequent text?
For example, after "<!ELEMENT %erk;", can it assume that "%erk;" only
expands to a 'Name', and covers no part of the 'contentspec'? Or does
it have to abandon any detailed parsing until it synchronizes with the
closing ">"?

Where exactly is a 'PEReference' allowed in a 'markupdecl' (other than
inside 'EntityValue')? Where "SYSTEM"/"PUBLIC"/"NDATA" are expected?
As the 'Name' of an entity or notation being declared? Inside, or as
the whole of, a 'SystemLiteral' or 'PubidLiteral'?

Thanks,

Steven

--
ss at comp dot lancs dot ac dot uk
Jul 20 '05 #1
1 1289
In article <d3**********@alliance.lancs.ac.uk>,
Steven Simpson <ss@domain.invalid> wrote:
If an XML processor encounters a 'PEReference' in a 'markupdecl' (but
not in 'EntityValue'), are there circumstances where it does not have to
include it (i.e. use the replacement text and re-parse), e.g. when not
validating? Or perhaps it would never have to have such an encounter
unless it was already required to include?
A non-validating processor can choose whether to expand parameter
entities, but once it has not processed one it must not process any
more entity or attlist declarations (because it may have missed an
overriding declaration).

In practice, I don't know of any parsers that selectively expand PEs.
Since the internal subset cannot contain PE references inside
declarations, a parser will only encounter such things if it is
processing the external subset. Since the external subset is exactly
the same as an external PE, I would expect any processor that read the
external subset to handle all PEs.
If it does not include, what can it assume about the subsequent text?
For example, after "<!ELEMENT %erk;", can it assume that "%erk;" only
expands to a 'Name', and covers no part of the 'contentspec'?
No. This is valid for example:

<!ENTITY % x "foo EMPTY">
<!ELEMENT %x;>

Furthermore, the proper nesting requirement is only a validity
constraint, so a non-validating parser should even accept

<!ENTITY % x "foo EMPTY> <!ATTLIST foo bar CDATA 'zzz'">
<!ELEMENT %x;>
Where exactly is a 'PEReference' allowed in a 'markupdecl' (other than
inside 'EntityValue')? Where "SYSTEM"/"PUBLIC"/"NDATA" are expected?
As the 'Name' of an entity or notation being declared? Inside, or as
the whole of, a 'SystemLiteral' or 'PubidLiteral'?


Almost anywhere, *but* the replacement text is enlarged with a space
at each end (see section 4.4.8 of the spec), so it won't work to put
one in the middle of a name for example. This effectively ensures
that PEs must expand to a sequence of complete tokens. (The
space-enlargement doesn't happen in entity values, so you can
construct arbitrary text out of PEs that way.)

% is not recognised as starting a PE reference in public and system
literals, so the question doesn't arise for them. Look at the
productions for literals in section 2.3 of the spec.

-- Richard
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
8
by: Tony Johansson | last post by:
Hello Experts! What does this mean actually. If you have a template with a type and non-type template argument, say, like this template<typename T, int a> class Array {. . .}; then A<int,...
2
by: John A Grandy | last post by:
Is there something special in XML about the name "Parameter" ... I am not able to XPATH query for nodes named "Parameter" <Root> <Category CategoryID="1"> <Elements> <Element...
7
by: Steve | last post by:
I used System.Diagnostics.Process.Start(str) to launch application. str is based on the registry setting, in registry, it might be str = rundll32.exe...
2
by: PK | last post by:
Hi, I have an application that opens a Crystal report document and passes in a value to a parameter in the report (pointing to an Oracle DB). However, if I want to pass a "null" value to retrieve...
7
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a...
4
by: Ranginald | last post by:
Hi, I'm having trouble passing a parameter from my default.aspx page to my default2.aspx page. I have values from a query in a list box and the goal is to pass the "catID" from default.aspx...
16
by: hzmonte | last post by:
Correct me if I am wrong, declaring formal parameters of functions as const, if they should not be/is not changed, has 2 benefits; 1. It tells the program that calls this function that the...
3
by: Ken Cox [Microsoft MVP] | last post by:
I've been going around and around on this one. I can't believe that it is "by design" as Microsoft says. Here's the situation: In *declarative* syntax, I'm trying to create a default datetime...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.