schema

.NET XmlSerializer to Element FormDefault=Unqualified XML?

I use C# code more-or-less like this to serialize an object to XML: XmlSerializer xs1 = new XmlSerializer(typeof(YourClassName)); StreamWriter sw1 = new StreamWriter(@"c:\DeserializeYourObject.xml"); xs1.Serialize(sw1, objYourObjectFromYourClassName); sw1.Close(); I want it to serialize like this: <ns0:Header xmlns:ns0="https:/...

Create a generic application that can read/write formatted text files based on schema

I often have a need to create input files for batch processes and to validate outputs from similar processes. The format of these files varies, e.g. they could be fixed-width, csv or sometimes XML. In the past I have created a little application in C# to help me work with a particular task. The application generally consists of a TreeV...

Version of SQLite used in Android?

Reason: Im wondering how to handle schema migrations. The newer SQLite versions support an "ALTER TABLE" SQL command which would save me having to copy data, drop the table, recreate table and re-insert data. ...

Django: How to dynamically add tag field to third party apps without touching app's source code

Scenario: large project with many third party apps. Want to add tagging to those apps without having to modify the apps' source. My first thought was to first specify a list of models in settings.py (like ['appname.modelname',], and call django-tagging's register function on each of them. The register function adds a TagField and a cus...

Is there any easy way to merge multiple XSDs into a single one?

To be more specific, I have a few (quite big) XSDs that are follow some common structure, but generally quite different. I also have to make a single XSD for merged XML files that should combine their respective XSDs. Example: <Container> <File id="id1_that_use_xsd1" /> <File id="id2_that_use_xsd2" /> <File id="id3_that_use...

Hotel Reservation system Database schema

Hi Everyone.... I am about to develop a online hotel reservation system...using php and mysql... I have some doubts about my current database schema and the business logic to get the hotels in which rooms are free between two particular dates... Does anyone know of some kind of tutorial where i can get some idea about the hotel reserva...

SQL Server "User-Schema Separation" and Entity Framework issues

I have been fooling around with EF with a database that has implemented user-schema separation with a twist, there are multiple tables with the same name but are separated via the schema. So like: admin.tasks staff.tasks contractor.tasks When I created my EF model I noticed that there were 3 tasks tables: tasks tasks1 tasks2 Is this...

Native SQL - How to set the schema and database names

Im using Native SQL from ABAP language. The query to get data is something like this SELECT COUNT(ROWID) FROM <SCHEMANAME>.<TABLENAME>;@<DATABASENAME> INTO :localvariable I want to somehow set the schemaname and database name as default so that i do not need to use them in the SELECTs later. Then i can only use the table name in the...

how to build xml schema

is there any tool that support xml schema building ...

Foreign key reference to a two-column primary key

I'm building a database that must work on MySQL, PostgreSQL, and SQLite. One of my tables has a two-column primary key: CREATE TABLE tournament ( state CHAR(2) NOT NULL, year INT NOT NULL, etc..., PRIMARY KEY(state, year) ); I want a reference to the tournament table from another table, but I want this reference to b...

SQL Is it possible to setup a column that will contain a value dependent on another column?

I have a table (A) that lists all bundles created off a machine in a day. It lists the date created and the weight of the bundle. I have an ID column, a date column, and a weight column. I also have a table (B) that holds the details related to that machine for the day. In that table (B), I want a column that lists a sum of weights from ...

Is the RESTORE process dependent on schema?

Let's say I have two database instances: InstanceA - Production server InstanceB - Test server My workflow is to deploy new schema changes to InstanceB first, test them, and then deploy them to InstanceA. So, at any one time, the instance schema relationship looks like this: InstanceA - Schema Version 1.5 InstanceB - Schema Vers...

How to reuse results with a schema for end of day stock-data

I am creating a database schema to be used for technical analysis like top-volume gainers, top-price gainers etc.I have checked answers to questions here, like the design question. Having taken the hint from boe100 's answer there I have a schema modeled pretty much on it, thusly: Symbol - char 6 //primary Date - dat...

Good conventions for embedding schema of a flat file

We receive lots of data as flat files: delimitted or just fixed length records. It's sometimes hard to find out what the files actually contain. Are there any well established practices for embedding the schema of the file to the beginning or the end of a file to make the file self-explanatory? Just to get an idea, imagine something l...

XML Schema (XSD) - How to specify parent element to contain at least one child element?

I have an XML schema (XSD) that defines an element as mandatory (call it the parent); this parent has, lets say, five child elements, which can all be optional, BUT AT LEAST ONE child element must occur. How can i specify this in the xsd? To clarify: The children are different elements and optional. For example. <Parent> <Child1>co...

Validating against a Schema with JAXB

I've been looking for solutions to this problem for far too long considering how easy it sounds so I've come for some help. I have an XML Schema which I have used with xjc to create my JAXB binding. This works fine when the XML is well formed. Unfortunately it also doesn't complain when the XML is not well formed. I cannot figure out...

JSON schema validation using java

I'm writing some acceptance tests for a java webapp that returns JSON objects. I would like to verify that the JSON returned validates against a schema. Can anyone suggest any tools for this? ...

xsd:choice on 'unconnected' elements

I have an xml that comes in two forms <root> <element1 req="mandatory"/> <element2/> <element3/> <root> and <root> <element2/> <element3/> <element4 req="mandatory"/> <root> element1 or elem4 is req'd 2 and 3 are optional. I just cant figure out how to use a xsd:choice on it, help, thanks. ...

add schema to path in postgresql

I'm the process of moving applications over from all in the public schema to each having their own schema. for each application, I have a small script that will create the schema and then create the tables,functions,etc... to that schema. Is there anyway to automatically add a newly created schema to the search_path? Currently, the on...

Online Collaborative Schema Design (leverage google docs?)

I'm looking for an online, collaborative database schema designer. App is for MySQL specifically, but generic DB designer is fine too. It's important that it can handle revisions (history of changes). This looks cool, and I could host it on a server - but doesn't look like it would handle multi-user: http://ondras.zarovi.cz/sql/demo/ ...