Refer to an XML document from within an XML documentIs there an "XML" way to reference an XML document from within an XML
document? How do I do this?
TIA,
- Manish
Manish Hatwalne wrote:
> Is there an "XML" way to reference an XML document from within an XML
> document? How do I do this?
XLink:
http://www.w3.org/TR/xlink/
XPointer framework:
http://www.w3.org/TR/xptr-framework/
http://www.w3.org/TR/xptr-element/
XInclude:
http://www.w3.org/TR/xinclude/
Check out yourself which of them comes close to what you understand
"reference an XML document" to do.
--
Martin Honnen
http://JavaScript.FAQTs.com/
...
XML schema validation of one xml block based on values from another xml blockHi!
Is possible to do xml validation of one xml block based on values from
another xml block?
For example, I have an input xml file containing account types.
<Root>
<AccountTypes>
<AccountType></AccountType>
�������������..
</AccountTypes>
<Accounts>
<Account>
<AccountType></AccountType>
</Account>
</Accounts>
</Root>
Is there a way I can put restriction in schema that <Account> must
have only such <AccountType> that are listed in <AccountTypes>
The file size is 20-25 MB. (It would not be a good idea to load it
into DOM)
It is preferably to catch it before processing will start
Thank you,
Andy
...
file command: "XML document text" vs "XML document text"I've just used the file command on four files of RDF-XML with the
following output:
augtfidf.rdf: XML document text
kyoto.rdf: XML document text
stuff.rdf: XML document text
tfidf.rdf: XML document text
What does it mean that one of them has an extra space between "XML"
and "document"?
--
The kid's a hot prospect. He's got a good head for merchandising, an
agent who can take you downtown and one of the best urine samples I've
seen in a long time. [Dead Kennedys t-shirt]
On 16.10.2012 16:06, Adam Funk wrote:
> I've just used the file command on four files of RDF-XML with the
> following output:
>
> augtfidf.rdf: XML document text
> kyoto.rdf: XML document text
> stuff.rdf: XML document text
> tfidf.rdf: XML document text
>
> What does it mean that one of them has an extra space between "XML"
> and "document"?
Hard to tell without further information.
What does file *.rdf | od -c show you?
Janis
Janis Papanagnou wrote:
> On 16.10.2012 16:06, Adam Funk wrote:
>> I've just used the file command on four files of RDF-XML with the
>> following output:
>>
>> augtfidf.rdf: XML document text
>> kyoto.rdf: XML document text
>> stuff.rdf: XML document text
>> tfidf.rdf: XML document text
>>
>> What does it mean that one ...
To XML or not to XML?Ok, it has been a while since I've needed to make an involved web page.
Coming back on the scene now is a bit confusing, what with all the cool
stuff to use like XML, PHP, MySQL, etc...
So here is my question. I'm in search of a good dynamic way to generate web
pages which separates content from presentation. I am seeking to create a
web site that, to put it succinctly, has a list of users and sets of
information corresponding to each user.
I am familiar with how to do this using PHP, MySQL, and regular old HTML. I
maintain the user database in MySQL and dynamically present it and the
information with PHP. This is very easy to do in terms of coding for it.
But I'm wondering? Is it time for me to switch to the XML with XSL method
instead? Everyone seems to be talking of XML as the end all be all. I've
looked into it, and on the surface, I just can't tell if it's worth it. I
don't really see the benefit. XML is just a "create your own HTML tags" and
then figure out wtf to do with them orgy. Great, so I can write
<dog>Spot</dog>. Whoop de do, that's useless to me unless I write a parser
for it to display it in a user friendly way. And I shouldn't have to write a
parser, there should be standardized ones for certain purposes. But wait,
isn't that what HTML already is? A bunch of <dog>Spot</dog> (figuratively
speaking) with the parsers having been written and mostly standardized
between companies ages ago...
XML or not XML?I am developing a simple MySQL database editor, and am looking into
creating an PHP/AJAX app as the GUI. A lot of this in new ground, and
much more is dusting off things I haven't used in a while. My question
though involves whether or nor to employ XML. I did some XML a few
years back, but don't typically bother anymore. As I see it XML is
great when I need to have an app with a standard data presentation that
other developers can easily interface. I.E. like a bank statement that
may feed a variety of applications developed by a variety of clients.
However, if I am develo...
XML to XMLI have a gnucash file that I'm trying to transform into an identical
XML file without the invoices.
I've been at this for a while now. The gnucash file is in XML and the
element I'm looking into is:
<gnc:transaction>
I want to ignore those that contain <slot:key>gncInvoice</slot:key>
which is a child of slot which is a child of slots which is a child of
transactions.
Any help you're willing to provide would be greatly appreciated.
Thanks.
Classic application for XSLT. Start with the identity transformation,
then add a template which matches the ones you want to treat specially
and yields no output. From your description that would be
match="gnc:transaction[transactions/slots/slot/slot:key='gncInvoice']"
with the namespaces declared appropriately in the stylesheet.
(That looks like a somewhat unlikely markup design to me, but since I
haven't played with gnucash at all I'm taking your word for it.)
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Actually, from the Relax-NG schema for gnucash, it looks like it should
be more like
"gnc:transaction[trn:slots/slot/slot:key='gncInvoice']"
with gnc:, trn:, and slot: all bound to the appropriate namespace URIs.
The fact that some of their elements -- eg <slot> -- aren't in any
namespace is probably left over from a pre-namespaces initial design, as
is their now-brok...
Newbie. xml "dynamically" including another xml documentHi,
I have an xml document with customer data. A test example starts
like this:
<?xml version="1.0" encoding="UTF-8"?>
<customer-info xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="cust-05.xsd">
<!-- Contain all properties of the customer in document element
-->
<customer cust-number="38273-815">
<cust-name title="Mr.">
<first>Clive</first>
<middle>Robert</middle>
<last>Long</last>
etc.
I have another xml document with a completely different structure:
<?xml version="1.0" encoding="UTF-8"?>
<occupation-list>
<occupation d="" tv="1" r="" s="" i="" p="" descr="ARCHITECTURE,
ENGINEERING, AND SURVEYING">arch-eng-surv</occupation>
<occupation d="" tv="2" r="" s="" i="" p="" descr="MATHEMATICS AND
PHYSICAL SCIENCES">math-phys</occupation>
etc.
Now I have an xslt that processes the data in the first xml document
but want to "refer" to the second xml document so that when the
occupations in the first doc are "looked up" in the second, I can
"read" the values of the attributes from the second document (d, i,
t...
Validating parsed XML document against XML-schema*PROBLEM: how to validate parsed XML document against (parsed) XML-schema.
*IN: XML document as org.w3c.dom.Document, XML-schema as stream
*OUT: information if document is valid against schema. If document is not
valid DETAILED information about ALL errors (especially: node that caused
problem).
*Additional information:
- validation is performed quite often,
- XML-document object is changed quite often,
- XML-Schema is fixed.
- XML-document doesn't contain information about related XML-schema
(attr xsi:noNamespaceSchemaLocation)
- XML-Sche...
Example of an XML document with an inline xml schemaHi All,
I'm looking for a little example of an xml document which is validated
using an inline xml schema. I'm a bit of a newbie, and I'm finding
this to be a bit of a mind bender, so an example or some pointers which
show me how to achieve this would be much appreciated.
I look forward to any help or advice any one can offer.
Naran
Here's a trivial example
<arbitrarytag xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="#local">
<xs:schema id="local">
<xs:element name="root" type="xs:integer"/>
</xs:schema>
<root>35a</root>
</arbitrarytag>
At least XSV [1] will process this in the desired way.
ht
[1] http://www.ltg.ed.ac.uk/~ht/xsv-status.html
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/inlschma.asp
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation
This posting is provided "AS IS" with...
Using One XSLT and multiple XML Problem (One is XML and another one is XBRL)Hi ~
Plz Help me ~~
My problem is..
XBRL Sample file
------------------
a.xbrl
<?xml version="1.0" encoding="utf-8"?>
<group xmlns="http://www.xbrl.org/2001/instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:link="http://www.xbrl.org/2001/XLink/xbrllinkbase"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ISO4217="http://www.iso.org/4217"
xmlns:aXinfo="http://www.love.com"
xmlns:kkw="http://www.love.com/xbrl/taxonomy"
xsi:schemaLocation="http://www.love.com/xbrl/taxonomy kkw.xsd">
<!-- PARAMETER INFO -->
<aXinfo:PARAMETER-INFO>
<aXinfo:param name="companyCD" value="50925"/>
.....
</aXinfo:PARAMETER-INFO>
<!-- ELEMENTS -->
<kkw:CRP_NM nonNumericContext="nonNumC1">cyber</kkw:CRP_NM>
<kkw:RSP_DPT nonNumericContext="nonNumC1">300</kkw:RSP_DPT>
.....
</group>
-----------------------
and xml sample
-----------------------
a.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="xbrl.xsl"?>
<DOCUMENT EID="1">
.....
</DOCUMENT EID="1">
-----------------------
XSLT transform a.xml.
I used document() function.
====> <xsl:value-of select="document(a.xbrl')/group/kkw:CRP_NM" />
But it...
q) XML Schema and valid XML documentsWikipedia provides the following definition for valid XML document
(http://en.wikipedia.org/wiki/XML):
it contains a reference to a Document Type Definition (DTD),
and that its elements and attributes are declared in that DTD
and follow the grammatical rules for them that the DTD
specifies.
There is no reference to XML Schema in the above defintion. I am
presuming that this is a dated definition for valid XML document and
that an XML document that has an XML Schema associated with it is also
a valid XML document.
Kindly confirm.
Thanks,
Ramesh
In article &l...
how to convert XML document to several XML documents in a new formatI'm migrating data into a content management system and in order to use
the import tool provided I need to change the format of a large xml
file and convert each entry to a seperate xml file.
This is what I have now:
<?xml version="1.0" encoding="UTF-8" ?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata"
generated="2005-04-18T12:05:51">
<Checklist>
<ID>1</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>2</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>3</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>4</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
</dataroot>
This is what I need each entry to be as a single file:
<?xml version="1.0" ?>
<file DocType="TypeName" DocTitle="TITLE:testing 123"
DocDesc="TITLE:testing 123">
<section name=...
embedding xml in xml as non-xml :)Hi all,
I have an application that logs in xml.
Assume <xmlLog></xmlLog>. In this element the app logs anything it gets
from foreign hosts. Now if the host sends xml data, the structure of the
document changes. ie. <xmlLog><somTag></somTag></xmlLog>. This will
cause problems with my log reader, because it assumes that <xmlLog/>
contains non-xml data.
My question is, is there a way to treat the data in the <xmlLog/>
element as non xml data. Something I can do that would treat anything
this element contains as a literal?
Any help or suggestions would be greatly appreciated.
Regards,
Mark
Mark Van Orman <mark@icsaccess.com> wrote:
> Hi all,
>
> I have an application that logs in xml.
>
> Assume <xmlLog></xmlLog>. In this element the app logs
> anything it gets from foreign hosts. Now if the host sends xml
> data, the structure of the document changes. ie.
> <xmlLog><somTag></somTag></xmlLog>. This will cause problems
> with my log reader, because it assumes that <xmlLog/> contains
> non-xml data.
>
> My question is, is there a way to treat the data in the
> <xmlLog/> element as non xml data. Something I can do that
> would treat anything this element contains as a literal?
>
> Any help or suggestions would be greatly ap...
web.xml / XML schema issue, why do some XML schema attributes disappearHi
I'm trying to get my j2ee app to run on Jboss (version 3.2.3), but
Jboss complains there are some missing attributes in the web-app
element. The attributes are present in the XML file, but they seem to
be removed by the parser, also when I view the file in a web browser.
My XML below (I have cut out a lot of stuff for the purpose of this
post)
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="...
XML::LibXML: Including xml fragments in a larger documentFor a project I receive some XML fragments from a data base and have
to include it in a larger XML document created with XML::LibXML. With
version 1.66 of XML::LibXML I was able to to something like
my $doc = XML::LibXML::Document->new('1.0', 'utf-8' );
my $root = $doc->createElement("X:root");
$doc->setDocumentElement($root);
my $node = XML::LibXML->new()->parse_balanced_chunk(
'<owner>peter@makholm.net</owner>'
);
$doc->adoptNode($node);
$root->addChild($node);
But with ...
Transfer XML schema to XML document in PL/SQLHi guys,
I have a problem with xml in PL/SQL
I am getting an xml schema from an stored prodedure, and supposed
to
use it to generate the new xml document(step1) and hardcode some values
for some
of the nodes inside the document(step2).
Can anyone give me a hand on both steps?
Really appreciated for any help in advance :)
Jun wrote:
> Hi guys,
>
> I have a problem with xml in PL/SQL
> I am getting an xml schema from an stored prodedure, and supposed
> to
> use it to generate the new xml document(step1) and hardcode some values
> for some
> o...
including one XML file in another XML fileHow can I include one XML file into another XML file (on the client
side, in Firefox)?
I think XInclude is just what I need, but Firefox doesn't support it:
https://bugzilla.mozilla.org/show_bug.cgi?id=201754
It seems I also can use an "external entity reference", but that
depends on a DTD and I'm using XML Schema. Is it also possible with a
Schema and how can I do it?
Here is exactly what I'm trying to do:
design.xml:
<?xml .....>
<root>
<design>....</design>
<library>....</library>
</root>
Currently the 'library' element is inside the 'design.xml' file. I
want to put the library element into a separate xml file and include
it in all my design files. (I have a lot of designs and only a couple
of libraries).
The design.xml file contains a reference to an XSLT file that
visualizes the design. When you open the design.xml file in Firefox a
SVG (scalable vector graphics) file is created on the fly and shown to
you.
I also have an XML Schema file that specifies what all the valid
elements in the design.xml file are.
Can someone show me an example that accomplishes this? That would be
great.
thanks, Johan.
> How can I include one XML file into another XML file (on the client
> side, in Firefox)?
I'm kind of new to XML, but let me take a stab at answering this.
Depending on what you want the client to do with the document, it
seems you might be able to accomplish this at th...
how to convert XML document to several XML documents in a new format #2I'm migrating data into a content management system and in order to use
the import tool provided I need to change the format of a large xml
file and convert each entry to a seperate xml file.
This is what I have now:
<?xml version="1.0" encoding="UTF-8" ?>
<dataroot xmlns:od="urn:schemas-microsoft-com:officedata"
generated="2005-04-18T12:05:51">
<Checklist>
<ID>1</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>2</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>3</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>4</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
</dataroot>
This is what I need each entry to be as a single file:
<?xml version="1.0" ?>
<file DocType="TypeName" DocTitle="TITLE:testing 123"
DocDesc="TITLE:testing 123">
<section name=...
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-fileHello,
i convert one XML-document by using XSLT into another XML-document.
First change all attributes to elements is no problem.
Then i try to insert a new element into the new document by XSLT,
but it doesn't work correctly :-(
Example:
The XML-source-document:
<?xml version="1.0" encoding="UTF-8"?>
<data creationTime="2006-05-31" creationNumber="1">
<set number="0001" info="test"/>
<set number="0002" info="test"/>
</data>
The following XML-destination-document has to become
(watch the new element "sets"):
<?xml version="1.0" encoding="UTF-8"?>
<data>
<creationTime>2006-05-31</creationTime>
<creationNumber>1</creationNumber>
<sets>
<set>
<number>0001</number>
<info>test</info>
</set>
<set>
<number>0002</number>
<info>test</info>
</set>
</sets>
</data>
Here is my XSLT-stylesheet-attempt:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:template match="@*">
<xsl:element name="{name()}">
<xsl:value-of select="."/>
</xsl:element>
<xsl:if test="n...
Multiple Input XML documents to produce one output XMLI have two input XML files. One lists all the expected elements
(default.xml) with default values and the other is the actual data
(data.xml). For any elements that are missing in data.xml, I want to
copy them from all.xml and put it in the resulting OUTPUT document
default.xml
<CLOTHES>
<JEANS>unknown/JEANS>
<SHIRTS>unknown</SHIRTS>
<TOPS>missing</TOPS>
<SWIMSUITS>missing</SWIMSUITS>
</CLOTHES>
data.xml
<CLOTHES>
<JEANS>xxx</JEANS>
<SHIRTS>yyy</SHIRTS>
<TOPS>zzz</TOPS>
</CLOTHES>
OUTPUT should look like this:
<CLOTHES>
<JEANS>xxx</JEANS>
<SHIRTS>yyy</SHIRTS>
<TOPS>zzz</TOPS>
<SWIMSUITS>missing</SWIMSUITS>
</CLOTHES>
How do i do this?
Thanks,
SV
Please try this XSLT stylesheet.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:common="http://exslt.org/common"
exclude-result-prefixes="common"
version="1.0">
<xsl:output method="xml" indent="yes" />
<xsl:variable name="doc1" select="/" />
<xsl:variable name="doc2" select="document('default.xml')" />
<xsl:template match="/">
<CLOTHES>
<xsl:variable...
Change to the public schema document for the XML namespace (xml.xsd)The schema document at http://www.w3.org/2001/xml.xsd has changed, in
order to (belatedly) track the change to xml:lang in XML 3rd edition [1],
which now allows the empty string as well as a language code.
Per the standard change policy, the old version is still available [2] and
will not be changed.
A copy of the new version which will never change is also available [3].
ht, on behalf of the W3C XML Core Working Group
[followups to public-xml-core-wg@w3.org, please]
[1] http://www.w3.org/TR/REC-xml/#sec-lang-tag
[2] http://www.w3.org/2004/10/xml.xsd
[3] http://www.w3.org/2005/08/xml.xsd
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
...
Including XSLT/XML document within a XSLT documentHi,
I'm trying to get rid of frames as menu holder in my html-page. I'd
also like to separate the menu structure to xml and xslt. Also the
actual content is divided to xml and its corresponding stylesheet.
The idea ofcourse is to import the separate menu.xml to the
content.xslt file so the menu markup wont clutter every content.xml
page.
I can do it by just including the menu as html in the content.xslt file
or a separate imported xslt file, but how on earth could i also
describe my menu as xml? I dont have a script-capable server, just
static files.
Regards,
Imiro
dar_imiro@hotmail.com wrote:
> Hi,
>
> I'm trying to get rid of frames as menu holder in my html-page. I'd
> also like to separate the menu structure to xml and xslt. Also the
> actual content is divided to xml and its corresponding stylesheet.
>
> The idea of course is to import the separate menu.xml to the
> content.xslt file so the menu markup wont clutter every content.xml
> page.
Right.
> I can do it by just including the menu as html in the content.xslt
> file or a separate imported xslt file, but how on earth could i also
> describe my menu as xml? I dont have a script-capable server, just
> static files.
If you have a menu.xml, you can open it and process all or part of it
in your mail XSLT stylesheet using the document() function.
<menu>
<main>
<item uri="foo">some label</item>
<item uri=&quo...
Is it possible to consume UTF8 XML documents using xml.dom.pulldom?I'm having a horrible time trying to get xml.dom.pulldom to consume a
UTF8 encoded XML file. Here's what I've tried so far:
>>> xml_utf8 = """<?xml version="1.0" encoding="UTF-8" ?>
<msg>Simon\xe2\x80\x99s XML nightmare</msg>
"""
>>> from xml.dom import pulldom
>>> parser = pulldom.parseString(xml_utf8)
>>> parser.next()
('START_DOCUMENT', <xml.dom.minidom.Document instance at 0x6f06c0>)
>>> parser.next()
('START_ELEMENT', <DOM Element: msg at 0...
Problem with shredding XML document into a DB2 table using XML ExtenderHello,
I am trying to shred a very simple XML document into a DB2 relational
table Music_Manuscript1, containing only two columns (Shelf_Mark,
RISM_Shelf_Mark).
However the functions stores each element contained in the root
element of the DAD on a separate row in the table instead of making
one record from them.
Could anyone tell how to solve this problem?
I use the following DAD:
---------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE DAD SYSTEM "c:\Program Files\dxx\dtd\dad.dtd">
<DAD>
...