I am using java to validate an XML file with a DTD, without having the
DVD declaration inside the original file, by setting the doctype
dynamically to a transformer like this :
transformer.setOutputProperty(OutputKeys.DOCTYPE_S YSTEM, dtd);
transformer.transform(source, new StreamResult(new
StringWriter()));
I would like to know if there is a way to validate an XML file with an
XSD, again, without having the declaration of the xsd file inside the
original XML file, but by declaring it dynamically.
Thank you ! 2 3917
killy971 schrieb:
I am using java to validate an XML file with a DTD, without having the
DVD declaration inside the original file, by setting the doctype
dynamically to a transformer like this :
transformer.setOutputProperty(OutputKeys.DOCTYPE_S YSTEM, dtd);
transformer.transform(source, new StreamResult(new
StringWriter()));
DTD validation is tightly connected to parsing. So you can parse the
result of the transformation with a validating parser.
I would like to know if there is a way to validate an XML file with an
XSD, again, without having the declaration of the xsd file inside the
original XML file, but by declaring it dynamically.
Have a look at "Chapter 14. Package javax.xml.validation" of "JSR 206
Java™ API for XML Processing (JAXP) 1.3".
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Johannes Koch schrieb:
killy971 schrieb:
>I am using java to validate an XML file with a DTD, without having the DVD declaration inside the original file, by setting the doctype dynamically to a transformer like this :
transformer.setOutputProperty(OutputKeys.DOCTYPE_S YSTEM, dtd); transformer.transform(source, new StreamResult(new StringWriter()));
DTD validation is tightly connected to parsing. So you can parse the
result of the transformation with a validating parser.
>I would like to know if there is a way to validate an XML file with an XSD, again, without having the declaration of the xsd file inside the original XML file, but by declaring it dynamically.
Have a look at "Chapter 14. Package javax.xml.validation" of "JSR 206
Java™ API for XML Processing (JAXP) 1.3".
In this case I'd transform into a DOMResult and then pass the resulting
node to the schema validation.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mike Dickens |
last post by:
hi,
i'm sure this has come up before but havn't managed to find an answer.
if i have the following xslt
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet method="xml" version="1.0"...
|
by: Zhenya Sigal via .NET 247 |
last post by:
I have the following code:
XmlElement parent= m_xmlDoc.CreateElement("parent", "http://tempuri.org/myns");
parent.InnerXml = "<child1>text</child1><child2>text</child2>";
...
|
by: Keith Hill |
last post by:
I am creating an XmlDocument in code and then using XmlTextWriter via
doc.WriteTo(xwriter) to output the result to a text box. I have a root
element that defines a default namespace. However, the...
|
by: NeilL |
last post by:
In the XML document I'm trying to create I do the following
elem = _doc.CreateElement("Author");
elem.InnerText = "something";
parentElem.AppendChild(elem);
Thiw works properly however the...
|
by: Jim Hsu |
last post by:
when I use the XmlWebSerivce to response the xmlelement to Web Service client.
the ASP.net plumbing work ( the XmlSerializer in WebServices ) will serialize the XML
if we can control the wrapper...
| |
by: ano |
last post by:
Hi,
Anyone knows how to get "xmlns" value from XML file?
For example, how to check that this xml file has a xmlns or not?
Or how to read the xmlns value?
<bookstore...
|
by: R. Ian Lee |
last post by:
I've built an XSLT file that transforms data to SpreadsheetML format. The
XSLT uses a <xsl:call-template/to build each worksheet. For some reason,
when I transform the file, it is inserting...
|
by: SolaFide |
last post by:
I have an XML doc that looks something like this:
<?xml version="1.0" encoding="utf-8"?>
<elem1>
<elem2 xmlns="http://someurl.com">
<elem3>
<item>some stuff here</item>
...
|
by: markmcgookin |
last post by:
Hi,
I am creating an MXL doc using XSLT but for some reason it is churning out elements like this
<DateTimeLastSaved xmlns="" />
<UserName xmlns="" />
when I delete xmlns="" it works fine,...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| | |