and don’t yet know enough to completely understand. Probably a few more
hours/days of study will get me there but I need this urgently so…
If you will post a short, complete data example, even just one record as
it
appears in your database, so we don’t have to try to read between the
lines, someone here will be happy to produce a way to filter the data in
the way you want.
Substitute the XPath expression with one of desired precision. I’m a
little unsure around how REXML treats namespaces in XPath and such, but
if you know what prefix will be used in the document, that should work
out.
The script might also require a little more massaging if you’re
outputting to plaintext, but treating XML like, well, XML might get the
heavy lifting of searching for patterns in it done faster if you use a
pattern language operating on the DOM structure directly.
If you will post a short, complete data example, even just one record
as it
appears in your database, so we don’t have to try to read between the
lines, someone here will be happy to produce a way to filter the data in
the way you want.
Ok, here are 4 bibliography entries. I just did a follow-up posting
with more detail (including the full script I’m trying to modify) so
you may prefer to respond to that one. Thank you very much for your
help!.
Ok, here are 4 bibliography entries. I just did a follow-up posting
with more detail (including the full script I’m trying to modify) so
you may prefer to respond to that one. Thank you very much for your
help!.
Okay, thanks for the data example. Now to move forward, could you please
tell us what you want to do with it? Which parts of the data end up in
the
output, and in what form?
You earlier said you wanted to process the XML to get a series of
\head
\head
\head
\head
But I think you mean these to be placeholders for the actual data, and I
can’t sort out which parts of the XML are meant to end up in the “\head”
elements.
It would help if you could show an example of the data in the XML and
its
literal relocation into the desired output format.
Postscript. I copied your posted data example and couldn’t parse it,
because
there is a mismatch between opening and closing tags – it’s a simple
sanity check I always perform when dealing with XML, and unfortunately
the
posted data isn’t a complete, internally consistent XML sample. That
would
have allowed me to indent/format the XML and get some idea of its
overall
structure.
Without an internally consistent XML data block with balanced tags, I
can’t
parse the XML, and if I can’t parse the XML, I can’t extract any data
from
it in a reliable way.
Thank you, David, for your pointers. I’m still very much a novice (at
the level of Chris P.'s Learn to Program) so I could not follow them
all, but I do hope to learn more fast. I just sent a follow-up with
more detail, including the script I’m trying to modify; I hope you have
a chance to look at it…
Ok, here are 4 bibliography entries. I just did a follow-up posting
text:style-name=“T3”>Die al-Azhar-Moschee</text:span><text:span
text:formula=“ooow:AutoNr+1”
147-149</text:span></text:p>
al-Maqbali (d. 1108/1728) Concerning the Legal Position of the
<text:p text:style-name=“reference”><text:span
text:style-name=“T10”>An Isma’ili Epistemology: The Case of
Al-Da’i al-Mutlaq 'Ali b. Muhammad b. al-Walid</text:span>.,
<text:span text:style-name=“Style2”>Journal of Semitic
Studies</text:span>, 41ii (1996), pp. 263-273.</text:p>
<text:p text:style-name=“reference”/>
<text:p text:style-name=“reference”/>