Sql XML type with a specific schema
Can I have a table with an xml column but when inserting value into that column it has to match a specific schema? I'm using Sql Server 2005. ...
Can I have a table with an xml column but when inserting value into that column it has to match a specific schema? I'm using Sql Server 2005. ...
Hi, Is there a standard (framework) mapping between CLR types and xsd type codes. I need to convert a string, int, decimal etc to the equivalent XmlSchemaSimpleType. I can construct the necessary simple type and use a case statement to do the mappings myself. I was hoping their might be a standard framework class that can either constr...
I created a Web Service which has a WSDL importing a schema(let's call it SCHEMA A) file which has no target namespace in it. It defines it's own types but also imports other schemas. So when the JAXB bindings were created the package given to the types coming from SCHEMA A was "generated". For the schemas imported the packages were fin...
<Item id="G1@MIT" type="GROUP"> <Item id="B1@MIT" type="BLOCKSEGMENT"/> <Item id="S1@MIT" type="SWITCH"/> </Item> xml content above is an example of my xml data. As you see I have Items that can contain other items. My first question is how to define xml schema in this situation. My second question is I want my id attribute to co...
I am curious about what are considered best practices when it comes to distributing XML schemas. In my particular situation, I have a webservice which accepts an XML file that must conform to an XSD that I have defined. I am thinking of distributing the XSD to clients via a complimentary webservice that can be invoked at any time. Ple...
Hi, Say I have a schema which defines an element as follows: <xsd:element name="Widget" type="tns:WidgetType" /> <xsd:complexType name="WidgetType"> <xsd:sequence> <xsd:element name="Name" type="xsd:normalizedString" maxOccurs="1" minOccurs="1" /> <xsd:element name="Description" type="xsd:normalizedString" default="Unknown" ...
I met a problem when JAXB unmarshalling xml data. JAXB throws exception when unmarshalling empty value for int, double or date attribute from xml. For example, it throws java.lang.NumberFormatException when it unmarshals the following xml data. <sku displayName="iphone" price=""/> The following is my schema. <?xml version="1.0" enco...
I'm looking for a Java library that would allow me to marshal XML to a Java object tree, and vice versa. There are plenty of libraries that would allow me to bind XML to JavaBeans generated by some code generation tool, however, I don't need those (JAXB, JiBX, Castor and so on). What I need is a tool which would consume a schema file a...
Is it possible to validate the following xml with the following schema? I'd like to validate the xml without specifying the schema in the xml file. I'm not sure if this is possible or not, but would appreciate some help figuring out how to do it. I keep getting the following error when I attempt to validate the xml. org.xml.sax.SAXPar...
Hi I'm currently working with creation and validation of XBRL instance documents in C#, and I've run into some problems regarding the XBRL instance schema file: http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd According to the .NET schema validator, the schema is not valid. It throws the following exception: System.Xml.Schema.Xm...
I just started using XSD today to bear with me if this a kind of a dumb question. I have an XML schema where three root elements, A, B, and C, are defined. Each of these elements may have a child of type 'example'. The 'example' type has three different attributes. While A, B, and C may only have a child of type 'example', the requirem...
I used xsd.exe to generate a schema file for some XML. I want to include that schema file in my C# project in Visual Studio, but every time I add the .xsd file to my project and then double-click it to open it, Visual Studio creates these .xss and .xsc files for my .xsd file and it alters my .xsd file. How can I get it to stop automagi...
This isn't a question about why XML is used for configuration files. My question is why, when XML is used for configuration files, there's no accompanying schema. log4net is a good case-in-point. You can configure it programmatically, but it's preferred that you use XML. Fine, but then why does it have to be so hard? In Visual Studi...
Hi all, This snippet <xsd:element name="HomePhone" minOccurs="0"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:pattern value="^+[0-9]{1,2}-[0-9]{1,2}-[0-9]{3}[0-9]{0,1}-[0-9]{3}[0-9]{0,1}$"></xsd:pattern> </xsd:restriction> </xsd:simpleType> </xsd:element> is returning th...
The .NET Framework exposes a rather useful set of classes as part of the System.Xml.Schema namespace. Among other things, classes such as XmlSchema and XmlSchemaElement provide a useful API for defining/writing and parsing/reading/traversing XML schema files. Does an equivalent library exist for Java? ...
Hi All, Hope you all are doing well. I need to import an XML-feed from a website to my SQL Server database. I don't know much about XML. The feed structure is an bit complex. Here is the sample of that file: <line_feed> <FeedTime>1279519582927</FeedTime> <lastContest>4103839</lastContest> <lastGame>58629754</lastGame> <events> <event...
I have an XML file like this: <?xml version="1.0" encoding="UTF-8"?> <items> <item id="1"> <valid_from>2010-07-09</valid_from> <valid_to>2010-07-12</valid_to> </item> <item id="2"> <valid_from>2010-07-09</valid_from> <valid_to>2009-07-12</valid_to> </item> </items> Is it possible to defi...
Given a few hundred java source files how can I generate an xsd schema that describes their class hierarchy, attributes and methods? Most of the resources I've seen describe how to convert java to xml given the schema but how is that schema created? I did find Simple but that requires me to alter the source which I am not allowed to do....
I'm having a time deciding on a direction to go with a class lib I'm building. I have a batch of industry standard XSD's, from which I'm generating .net objects. I;ve used all of XSD.exe, LinqtoXsd, xsd2code, and even OxmLibrary with varying results. But in the end, I am able to generate decent .net classes which can be serialized/dese...
I'm hoping you can help me narrow my research on how to "modernize" my use of SQL XML... I recently "dusted off" a bit of something I cobbled together several years ago. It utilizes something called SQLXML 3.0 and IIS Virtual Directory Management for SQLXML 3.0 resulting in an XML template that contains a SQL EXECUTE of a stored procedu...