Search Results

Search found 17914 results on 717 pages for 'xml schema'.

Page 3/717 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • delete element from xml using LINQ

    - by Shishir
    Hello I've a xml file like: <starting> <start> <site>mushfiq.com</site> <site>mee.con</site> <site>ttttt.co</site> <site>jkjhkhjkh</site> <site>jhkhjkjhkhjkhjkjhkh</site> <site>dasdasdasdasdasdas</site> </start> </starting> Now I need to delete any ... and value will randomly be given from a textbox. Here is my code : XDocument doc = XDocument.Load(@"AddedSites.xml"); var deleteQuery = from r in doc.Descendants("start") where r.Element("site").Value == txt.Text.Trim() select r; foreach (var qry in deleteQuery) { qry.Element("site").Remove(); } doc.Save(@"AddedSites.xml"); If I put the value of first element in the textbox then it can delete it, but if I put any value of element except the first element's value it could not able to delete! I need I'll put any value of any element...as it can be 2nd element or 3rd or 4th and so on.... can anyone help me out? thanks in advanced!

    Read the article

  • Is the RESTORE process dependent on schema?

    - by Martin Aatmaa
    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 Version 1.6 (new version being tested) An additional part of my workflow is to keep the data in InstanceB as fresh as possible. To fulfill this, I am taking the database backups of InstanceA and applying them (restoring them) to InstanceB. My question is, how does schema version affect the restoral process? I know I can do this: Backup InstanceA - Schema Version 1.5 Restore to InstanceB - Schema Version 1.5 But can I do this? Backup InstanceA - Schema Version 1.5 Restore to InstanceB - Schema Version 1.6 (new version being tested) If no, what would the failure look like? If yes, would the type of schema change matter? For example, if Schema Version 1.6 differed from Schema Version 1.5 by just having an altered storec proc, I imagine that this type of schema change should't affect the restoral process. On the other hand, if Schema Version 1.6 differed from Schema Version 1.5 by having a different table definition (say, an additional column), I image this would affect the restoral process. I hope I've made this clear enough. Thanks in advance for any input!

    Read the article

  • Oracle Data Mining a Star Schema: Telco Churn Case Study

    - by charlie.berger
    There is a complete and detailed Telco Churn case study "How to" Blog Series just posted by Ari Mozes, ODM Dev. Manager.  In it, Ari provides detailed guidance in how to leverage various strengths of Oracle Data Mining including the ability to: mine Star Schemas and join tables and views together to obtain a complete 360 degree view of a customer combine transactional data e.g. call record detail (CDR) data, etc. define complex data transformation, model build and model deploy analytical methodologies inside the Database  His blog is posted in a multi-part series.  Below are some opening excerpts for the first 3 blog entries.  This is an excellent resource for any novice to skilled data miner who wants to gain competitive advantage by mining their data inside the Oracle Database.  Many thanks Ari! Mining a Star Schema: Telco Churn Case Study (1 of 3) One of the strengths of Oracle Data Mining is the ability to mine star schemas with minimal effort.  Star schemas are commonly used in relational databases, and they often contain rich data with interesting patterns.  While dimension tables may contain interesting demographics, fact tables will often contain user behavior, such as phone usage or purchase patterns.  Both of these aspects - demographics and usage patterns - can provide insight into behavior.Churn is a critical problem in the telecommunications industry, and companies go to great lengths to reduce the churn of their customer base.  One case study1 describes a telecommunications scenario involving understanding, and identification of, churn, where the underlying data is present in a star schema.  That case study is a good example for demonstrating just how natural it is for Oracle Data Mining to analyze a star schema, so it will be used as the basis for this series of posts...... Mining a Star Schema: Telco Churn Case Study (2 of 3) This post will follow the transformation steps as described in the case study, but will use Oracle SQL as the means for preparing data.  Please see the previous post for background material, including links to the case study and to scripts that can be used to replicate the stages in these posts.1) Handling missing values for call data recordsThe CDR_T table records the number of phone minutes used by a customer per month and per call type (tariff).  For example, the table may contain one record corresponding to the number of peak (call type) minutes in January for a specific customer, and another record associated with international calls in March for the same customer.  This table is likely to be fairly dense (most type-month combinations for a given customer will be present) due to the coarse level of aggregation, but there may be some missing values.  Missing entries may occur for a number of reasons: the customer made no calls of a particular type in a particular month, the customer switched providers during the timeframe, or perhaps there is a data entry problem.  In the first situation, the correct interpretation of a missing entry would be to assume that the number of minutes for the type-month combination is zero.  In the other situations, it is not appropriate to assume zero, but rather derive some representative value to replace the missing entries.  The referenced case study takes the latter approach.  The data is segmented by customer and call type, and within a given customer-call type combination, an average number of minutes is computed and used as a replacement value.In SQL, we need to generate additional rows for the missing entries and populate those rows with appropriate values.  To generate the missing rows, Oracle's partition outer join feature is a perfect fit.  select cust_id, cdre.tariff, cdre.month, minsfrom cdr_t cdr partition by (cust_id) right outer join     (select distinct tariff, month from cdr_t) cdre     on (cdr.month = cdre.month and cdr.tariff = cdre.tariff);   ....... Mining a Star Schema: Telco Churn Case Study (3 of 3) Now that the "difficult" work is complete - preparing the data - we can move to building a predictive model to help identify and understand churn.The case study suggests that separate models be built for different customer segments (high, medium, low, and very low value customer groups).  To reduce the data to a single segment, a filter can be applied: create or replace view churn_data_high asselect * from churn_prep where value_band = 'HIGH'; It is simple to take a quick look at the predictive aspects of the data on a univariate basis.  While this does not capture the more complex multi-variate effects as would occur with the full-blown data mining algorithms, it can give a quick feel as to the predictive aspects of the data as well as validate the data preparation steps.  Oracle Data Mining includes a predictive analytics package which enables quick analysis. begin  dbms_predictive_analytics.explain(   'churn_data_high','churn_m6','expl_churn_tab'); end; /select * from expl_churn_tab where rank <= 5 order by rank; ATTRIBUTE_NAME       ATTRIBUTE_SUBNAME EXPLANATORY_VALUE RANK-------------------- ----------------- ----------------- ----------LOS_BAND                                      .069167052          1MINS_PER_TARIFF_MON  PEAK-5                   .034881648          2REV_PER_MON          REV-5                    .034527798          3DROPPED_CALLS                                 .028110322          4MINS_PER_TARIFF_MON  PEAK-4                   .024698149          5From the above results, it is clear that some predictors do contain information to help identify churn (explanatory value > 0).  The strongest uni-variate predictor of churn appears to be the customer's (binned) length of service.  The second strongest churn indicator appears to be the number of peak minutes used in the most recent month.  The subname column contains the interior piece of the DM_NESTED_NUMERICALS column described in the previous post.  By using the object relational approach, many related predictors are included within a single top-level column. .....   NOTE:  These are just EXCERPTS.  Click here to start reading the Oracle Data Mining a Star Schema: Telco Churn Case Study from the beginning.    

    Read the article

  • Encode double quotes inside XML element using LINQ to XML

    - by davekaro
    I'm parsing a string of XML into an XDocument that looks like this (using XDocument.Parse) <Root> <Item>Here is &quot;Some text&quot;</Item> </Root> Then I manipulate the XML a bit, and I want to send it back out as a string, just like it came in <Root> <Item>Here is &quot;Some text&quot;</Item> <NewItem>Another item</NewItem> </Root> However, what I am getting is <Root> <Item>Here is \"Some text\"</Item> <NewItem>Another item</NewItem> </Root> Notice how the double quotes are now escaped instead of encoded? This happens whether I use ToString(SaveOptions.DisableFormatting); or var stringWriter = new System.IO.StringWriter(); xDoc.Save(stringWriter, SaveOptions.DisableFormatting); var newXml = stringWriter.GetStringBuilder().ToString(); How can I have the double quotes come out as &quot; and not \"? UPDATE: Maybe this can explain it better: var origXml = "<Root><Item>Here is \"Some text&quot;</Item></Root>"; Console.WriteLine(origXml); var xmlDoc = System.Xml.Linq.XDocument.Parse(origXml); var modifiedXml = xmlDoc.ToString(System.Xml.Linq.SaveOptions.DisableFormatting); Console.WriteLine(modifiedXml); the output I get from this is: <Root><Item>Here is "Some text&quot;</Item></Root> <Root><Item>Here is "Some text"</Item></Root> I want the output to be: <Root><Item>Here is "Some text&quot;</Item></Root> <Root><Item>Here is "Some text&quot;</Item></Root>

    Read the article

  • xml schema and using a choice as the document root

    - by mikey
    I have a bit of a newbie xml schema question. I believe the answer is that what I need to do is not possible with schema, but I'd like to be sure. The problem is that I have a webservice that returns a response with one type of root element on success (say <Response), and on a complete failure, returns a document with a different root element (say, <Exception). So, basically, two completely different documents: <Response......</Response OR <Exception....</Exception Is it possible to describe these two different documents with one schema document? It's like I want a choice as the first element under the schema element -- but that isn't valid syntax. I've tried a couple of variants that parse as valid xsd, but don't validate the documents. Any suggestions? Or is this simply not possible? Thanks very much in advance -- m

    Read the article

  • XML Schema to restrict one field based on another

    - by Kevin Albrecht
    I have the following schema, which I use to ensure that a person's PhoneNumber and PhoneNumberType (Home, Work, etc.) is not longer than 10 characters. However, I want to improve this schema so that PhoneNumberType is not required if a PhoneNumber is not provided, but is required if the PhoneNumber is provided. Is there a way to do this in XML Schema 1.0? <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xs:element name="PhoneNumber"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="0"/> <xs:maxLength value="10"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="PhoneNumberType"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="0"/> <xs:maxLength value="10"/> </xs:restriction> </xs:simpleType> </xs:element> </xsd:schema>

    Read the article

  • save xml object so that elements are in sorted order in saved xml file

    - by scot
    Hi , I am saving a xml document object and it is saved in a xml file as shown below . <author name="tom" book="Fun-II"/> <author name="jack" book="Live-I"/> <author name="pete" book="Code-I"/> <author name="jack" book="Live-II"/> <author name="pete" book="Code-II"/> <author name="tom" book="Fun-I"/> instead i want to sort the content in document object so that when i persist the object it is saved by grouping authors then book name as below: <author name="jack" book="Live-I"/> <author name="jack" book="Live-II"/> <author name="pete" book="Code-I"/> <author name="pete" book="Code-II"/> <author name="tom" book="Fun-I"/> <author name="tom" book="Fun-II"/> I use apache xml beans..any ideas on how to achieve this? thanks.

    Read the article

  • XML validation error when using multiple schema files/namespaces

    - by user129609
    Hi, I've been reading a ton about xml and learning a lot but I am stuck on one error. I have a schema defined in multiple files and I can't get it to work. Here is an example ================================== libraryBooks.xsd <?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:MyNamespace" targetNamespace="urn:MyNamespace" elementFormDefault="qualified" > <xsd:element name="libraryBooks" type="libraryBooksType"/> <xsd:complexType name="libraryBooksType"> <xsd:sequence> <xsd:any minOccurs="0"/> </xsd:sequence> <xsd:attribute name="name" type="xsd:string"/> </xsd:complexType> </xsd:schema> ================================== book.xsd <?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:MyNamespace2" targetNamespace="urn:MyNamespace2" elementFormDefault="qualified" > <xsd:element name="book" type="booksType"/> <xsd:complexType name="bookType"> <xsd:attribute name="title" type="xsd:string"/> </xsd:complexType> </xsd:schema> ================================== myXml.xml <?xml version="1.0" encoding="utf-8" ?> <libraryBooks xmlns="urn:MyNamespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:MyNamespace file:///C:/libraryBooks.xsd" name="CentralLibrary"> <mn2:book xmlns:mn2="file:///C:/book.xsd" title="How to make xml work the way I want"> </mn2:book> </libraryBooks> So the error I get would be "The 'file:///C:/book.xsd:book' element is not found". Any ideas? I'm almost certain it is something simple

    Read the article

  • Creating a 'flexible' XML schema

    - by Fiona Holder
    I need to create a schema for an XML file that is pretty flexible. It has to meet the following requirements: Validate some elements that we require to be present, and know the exact structure of Validate some elements that are optional, and we know the exact structure of Allow any other elements Allow them in any order Quick example: XML <person> <age></age> <lastname></lastname> <height></height> </person> My attempt at an XSD: <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="person"> <xs:complexType> <xs:sequence> <xs:element name="firstname" minOccurs="0" type="xs:string"/> <xs:element name="lastname" type="xs:string"/> <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Now my XSD satisfies requirements 1 and 3. It is not a valid schema however, if both firstname and lastname were optional, so it doesn't satisfy requirement 2, and the order is fixed, which fails requirement 4. Now all I need is something to validate my XML. I'm open to suggestions on any way of doing this, either programmatically in .NET 3.5, another type of schema etc. Can anyone think of a solution to satisfy all 4 requirements?

    Read the article

  • Need some help with my XML Schema.

    - by Airjoe
    I'm using Qt C++ and am reading in an XML file for data. I want to ensure the XML file contains valid elements, so I began to write an XML Schema to validate against (Qt doesn't support validating against a DTD). The problem is, I'm not sure if my Schema itself is valid, and I can't seem to find an actual XSD validator. I tried using the official w3c validator at http://www.w3.org/2001/03/webdata/xsv, but it's giving me blank output. Would anyone know of a decent XSD validator, or perhaps be willing to look over the following manually? <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="ballot"> <xs:complexType> <xs:sequence> <xs:element name="races"> <xs:complexType> <xs:element name="race" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="rtitle" minOccurs="1" maxOccurs="1" type="xs:string"/> <xs:element name="candidates" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:element name="candidate" minOccurs="1" maxOccurs="10"> <xs:complexType> <xs:element name="candname" minOccurs="1" maxOccurs="1" type="xs:string"/> <xs:element name="candparty" minOccurs="1" maxOccurs="1" type="xs:string"/> </xs:complexType> </xs:element> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:complexType> </xs:element> <xs:element name="propositions"> <xs:complexType> <xs:element name="proposition" minOccurs="1" maxOccurs="unbounded"> <xs:complexType> <xs:element name="ptitle" minOccurs="1" maxOccurs="1" type="xs:string"/> <xs:element name="pdesc" minOccurs="1" maxOccurs="1" type="xs:string"/> </xs:complexType> </xs:element> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Please let me know what you think, I appreciate it!

    Read the article

  • remove xml declaration from the generated xml document using java

    - by flash
    String root = "RdbTunnels"; DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); Document document = documentBuilder.newDocument(); Element rootElement = document.createElement(root); document.appendChild(rootElement); OutputFormat format = new OutputFormat(document); format.setIndenting(true); XMLSerializer serializer = new XMLSerializer(System.out, format); serializer.serialize(document); gives the result as following <?xml version="1.0" encoding="UTF-8"?> <RdbTunnels/> but I need to remove the xml declaration from the output how can I do that

    Read the article

  • Deserialize an XML file - an error in xml document (1,2)

    - by Lindsay Fisher
    I'm trying to deserialize an XML file which I receive from a vendor with XmlSerializer, however im getting this exception: There is an error in XML document (1, 2).InnerException Message "<delayedquotes xmlns=''> was not expected.. I've searched the stackoverflow forum, google and implemented the advice, however I'm still getting the same error. Please find the enclosed some content of the xml file: <delayedquotes id="TestData"> <headings> <title/> <bid>bid</bid> <offer>offer</offer> <trade>trade</trade> <close>close</close> <b_time>b_time</b_time> <o_time>o_time</o_time> <time>time</time> <hi.lo>hi.lo</hi.lo> <perc>perc</perc> <spot>spot</spot> </headings> <instrument id="Test1"> <title id="Test1">Test1</title> <bid>0</bid> <offer>0</offer> <trade>0</trade> <close>0</close> <b_time>11:59:00</b_time> <o_time>11:59:00</o_time> <time>11:59:00</time> <perc>0%</perc> <spot>0</spot> </instrument> </delayedquotes> and the code [Serializable, XmlRoot("delayedquotes"), XmlType("delayedquotes")] public class delayedquotes { [XmlElement("instrument")] public string instrument { get; set; } [XmlElement("title")] public string title { get; set; } [XmlElement("bid")] public double bid { get; set; } [XmlElement("spot")] public double spot { get; set; } [XmlElement("close")] public double close { get; set; } [XmlElement("b_time")] public DateTime b_time { get; set; } [XmlElement("o_time")] public DateTime o_time { get; set; } [XmlElement("time")] public DateTime time { get; set; } [XmlElement("hi")] public string hi { get; set; } [XmlElement("lo")] public string lo { get; set; } [XmlElement("offer")] public double offer { get; set; } [XmlElement("trade")] public double trade { get; set; } public delayedquotes() { } }

    Read the article

  • Handling element collisions on importing/including XML schemas

    - by eggyal
    Given schema definitions that define the same element differently, can one import/include both definitions and reference them independently from within a third schema definition? For example, given: <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:example:namespace"> <element name="message" type="boolean"/> </schema> and: <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:example:namespace"> <element name="message" type="date"/> </schema> Can one construct the following: <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:example:namespace"> <complexType name="booleanMessageType"> <xs:sequence> <!-- reference to first definition here --> </xs:sequence> </complexType> <complexType name="dateMessageType"> <xs:sequence> <!-- reference to second definition here --> </xs:sequence> </complexType> </schema>

    Read the article

  • XML Reader or Linq to XML

    - by Nasser Hajloo
    I have a 150MB XML file which used asDB in my project. Currently I'm using XMLReader to read content from it. I want to know it is better to use XMLReader or LinqToXML for this scenario. Note that I'm searching for an item in this xmland display search result, soitcan be take along or just a moment.

    Read the article

  • XML Schema and element with type string

    - by svick
    I'm trying to create an XML Schema and I'm stuck. It seems I can't define an element with string content. What am I doing wrong? Schema: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ponderka.wz.cz/MusicLibrary0" targetNamespace="http://ponderka.wz.cz/MusicLibrary0"> <xs:element name="music-library"> <xs:complexType> <xs:sequence> <xs:element name="artist" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> Document: <?xml version="1.0"?> <music-library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ponderka.wz.cz/MusicLibrary0 data0.xsd" xmlns="http://ponderka.wz.cz/MusicLibrary0"> <artist>a</artist> </music-library> The validator says: Element <artist> is not allowed under element <music-library>. Reason: The following elements are expected at this location (see below) <artist> Error location: music-library / artist Details cvc-model-group: Element <artist> unexpected by type '{anonymous}' of element <music-library>. cvc-elt.5.2.1: The element <music-library> is not valid with respect to the actual type definition '{anonymous}'.

    Read the article

  • Schema design: many to many plus additional one to many

    - by chrisj
    Hi, I have this scenario and I'm not sure exactly how it should be modeled in the database. The objects I'm trying to model are: teams, players, the team-player membership, and a list of fees due for each player on a given team. So, the fees depend on both the team and the player. So, my current approach is the following: **teams** id name **players** id name **team_players** id player_id team_id **team_player_fees** id team_players_id amount send_reminder_on Schema layout ERD In this schema, team_players is the junction table for teams and players. And the table team_player_fees has records that belong to records to the junction table. For example, playerA is on teamA and has the fees of $10 and $20 due in Aug and Feb. PlayerA is also on teamB and has the fees of $25 and $25 due in May and June. Each player/team combination can have a different set of fees. Questions: Are there better ways to handle such a scenario? Is there a term for this type of relationship? (so I can google it) Or know of any references with similar structures?

    Read the article

  • Can XMLCatalog be used for schema imports?

    - by jon077
    Can you use XMLCatalog to resolve xsds in schema import statements? If so, what is the preferred/best practice? I want to package the xsds in a jar, so using a relative schemaLocation has not worked. So far I am trying to do something like: SchemaFactory factory = SchemaFactory .newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); XMLCatalogResolver catalogResolver = new XMLCatalogResolver( new String[]{"/path/to/catalog.xml"}); factory.setResourceResolver(catalogResolver); Schema schema = factory.newSchema(new StreamSource(ClassLoader .getSystemResourceAsStream("config.xsd"))); Without much luck.

    Read the article

  • parser the xml and build a ui for user

    - by hguser
    Hi: Now I have to handle some xml in my java swing application. I have to build a swing ui according to the special schema ,then user can fill some values.After user completed,I will collect the information,validate the value and then build a xml file. For building xml file I can use the xmlbeans,however how to parse the schema and build a swing ui? Since the schema is rather complex. A schema can be found here: example schema I have to parser this schema,for the LiteralInputType ,a JTextArea should be built. However there are other types "complexType" and etc.. These types may not occur at the sametime. Some times only the LiteralInputType is needed,somethimes the ComplexType is needed,also maybe all of them are needed. So, how to implement it? Anyone can help me?

    Read the article

  • Database Schema Usage

    - by CrazyHorse
    I have a question regarding the appropriate use of SQL Server database schemas and was hoping that some database gurus might be able to offer some guidance around best practice. Just to give a bit of background, my team has recently shrunk to 2 people and we have just been merged with another 6 person team. My team had set up a SQL Server environment running off a desktop backing up to another desktop (and nightly to the network), whilst the new team has a formal SQL Server environment, running on a dedicated server, with backups and maintenance all handled by a dedicated team. So far it's good news for my team. Now to the query. My team designed all our tables to belong to a 3-letter schema name (e.g. User = USR, General = GEN, Account = ACC) which broadly speaking relate to specific applications, although there is a lot of overlap. My new team has come from an Access background and have implemented their tables within dbo with a 3-letter perfix followed by "_tbl" so the examples above would be dbo.USR_tblTableName, dbo.GEN_tblTableName and dbo.ACC_tblTableName. Further to this, neither my old team nor my new team has gone live with their SQL Servers yet (we're both coincidentally migrating away from Access environments) and the new team have said they're willing to consider adopting our approach if we can explain how this would be beneficial. We are not anticipating handling table updates at schema level, as we will be using application-level logins. Also, with regards to the unwieldiness of the 7-character prefix, I'm not overly concerned myself as we're using LINQ almost exclusively so the tables can simply be renamed in the DMBL (although I know that presents some challenges when we update the DBML). So therefore, given that both teams need to be aligned with one another, can anyone offer any convincing arguments either way?

    Read the article

  • XML Schema to Java Classes with XJC

    - by nevets1219
    I am using xjc to generate Java classes from the XML schema and the following is an excerpt of the XSD. <xs:element name="NameInfo"> <xs:complexType> <xs:sequence> <xs:choice> <xs:element ref="UnstructuredName"/> <!-- This line --> <xs:sequence> <xs:element ref="StructuredName"/> <xs:element ref="UnstructuredName" minOccurs="0"/> <!-- and this line! --> </xs:sequence> </xs:choice> <xs:element ref="SomethingElse" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> For the most part the generated classes are fine but for the above block I would get something like: public List<Object> getContent() { if (content == null) { content = new ArrayList<Object>(); } return this.content; } with the following comment above it: * You are getting this "catch-all" property because of the following reason: * The field name "UnstructuredName" is used by two different parts of a schema. See: * line XXXX of file:FILE.xsd * line XXXX of file:FILE.xsd * To get rid of this property, apply a property customization to one * of both of the following declarations to change their names: * Gets the value of the content property. I have placed a comment at the end of the two line in question. At the moment, I don't think it will be easy to change the schema since this was decided between vendors and I would not want to go this route (if possible) as it will slow down progress quite a bit. I searched and have found this page, is the external customization what I want to do? I have been mostly working with the generated classes so I'm not entirely familiar with the process that generates these classes. A simple example of the "property customization" would be great! Alternative method of generating the Java classes would be fine as long as the schema can still be used.

    Read the article

  • XML Schema (XSD) to Rails ActiveRecord Mapping?

    - by Incomethax
    I'm looking for a way to convert an XML Schema definition file into an ActiveRecord modeled database. Does anyone know of a tool that happens to do this? So far the best way I've found is to first load the XSD into an RDBMS like postgres or mysql and then have rails connect to do a rake db:schema:dump. This however, only leaves me with a database without rails Models. What would be the best way to import/load this xsd based database into rails?

    Read the article

  • Design considerations on JSON schema for scalars with a consistent attachment property

    - by casperOne
    I'm trying to create a JSON schema for the results of doing statistical analysis based on disparate pieces of data. The current schema I have looks something like this: { // Basic key information. video : "http://www.youtube.com/watch?v=7uwfjpfK0jo", start : "00:00:00", end : null, // For results of analysis, to be populated: // *** This is where it gets interesting *** analysis : { game : { value: "Super Street Fighter 4: Arcade Edition Ver. 2012", confidence: 0.9725 } teams : [ { player : { value : "Desk", confidence: 0.95, } characters : [ { value : "Hakan", confidence: 0.80 } ] } ] } } The issue is the tuples that are used to store a value and the confidence related to that value (i.e. { value : "some value", confidence : 0.85 }), populated after the results of the analysis. This leads to a creep of this tuple for every value. Take a fully-fleshed out value from the characters array: { name : { value : "Hakan", confidence: 0.80 } ultra : { value: 1, confidence: 0.90 } } As the structures that represent the values become more and more detailed (and more analysis is done on them to try and determine the confidence behind that analysis), the nesting of the tuples adds great deal of noise to the overall structure, considering that the final result (when verified) will be: { name : "Hakan", ultra : 1 } (And recall that this is just a nested value) In .NET (in which I'll be using to work with this data), I'd have a little helper like this: public class UnknownValue<T> { T Value { get; set; } double? Confidence { get; set; } } Which I'd then use like so: public class Character { public UnknownValue<Character> Name { get; set; } } While the same as the JSON representation in code, it doesn't have the same creep because I don't have to redefine the tuple every time and property accessors hide the appearance of creep. Of course, this is an apples-to-oranges comparison, the above is code while the JSON is data. Is there a more formalized/cleaner/best practice way of containing the creep of these tuples in JSON, or is the approach above an accepted approach for the type of data I'm trying to store (and I'm just perceiving it the wrong way)? Note, this is being represented in JSON because this will ultimately go in a document database (something like RavenDB or elasticsearch). I'm not concerned about being able to serialize into the object above, because I can always use data transfer objects to facilitate getting data into/out of my underlying data store.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >