Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7791453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:53:30+00:00 2026-06-01T21:53:30+00:00

I have a flattened XSD here: http://pastebin.com/tQVSH9Jp I have a ‘substitution’ XSLT script I

  • 0

I have a flattened XSD here:
http://pastebin.com/tQVSH9Jp

I have a ‘substitution’ XSLT script I am running against it to fix it for XSD.exe (which ignores referenced elements), however the resultant XSD is missing a few properties. (ID is not present in UniqueID_Type).

Can anyone provide an XSLT script that will correctly perform these substitutions, or even provide another solution altogether?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:53:32+00:00Added an answer on June 1, 2026 at 9:53 pm

    It’s funny that someone suggested to write your own xsd.exe, and also to rely on XmlSchemaImporter… For one, I don’t think it is a trivial task; secondly, the problem with the missing attribute comes from XmlSchemaImporter; there’s a bug in ImportAttributeGroupMembers: instead of looking for an XmlSchemaAttributeGroupRef, it is checking for an XmlSchemaAttributeGroup (excerpt below courtesy of Reflector):

    private void ImportAttributeGroupMembers(XmlSchemaAttributeGroup group, string identifier, CodeIdentifiers members, CodeIdentifiers membersScope, string ns)
    {
        for (int i = 0; i < group.Attributes.Count; i++)
        {
            object obj2 = group.Attributes[i];
            if (obj2 is XmlSchemaAttributeGroup)
            {
                ...
            }
            else if (obj2 is XmlSchemaAttribute)
            {
               ...
            }
         }
         ...
    }
    

    There’s a similar utility, xsd2code which I would try with the original XSD before going into XML Schema Refactoring (XSR).

    If you want to go down this route, I recommend QTAssistant for XSR (I am associated with it). I’ve tried your XSD with the latest version (4.0.21) and it worked. I’ve posted the result here.

    The generated code using XSD.exe for the fragment you pointed out as defective (I am just showing the fields) now shows the idField for the ID attribute:

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.opentravel.org/OTA/2003/05")]
    public partial class UniqueID_Type {
    
        private CompanyNameType companyNameField;
    
        private string uRLField;
    
        private string typeField;
    
        private string instanceField;
    
        private string idField;
    
        private string iD_ContextField;
    
        ...
    }
    

    What’s specific for your setup is the InlineAttributeGroups that must be set to true:

    QTAssistant setting InlineAttributeGroups

    If you’re interested in more details about refactoring using QTAssistant, please take a look at this post, also on SO. Anyway, I’ve posted the entire refactored schema, feel free to use it…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read here http://lostechies.com/jimmybogard/2009/09/18/the-case-for-two-way-mapping-in-automapper/ about how you probably shouldn't be trying to un-flatten
I have a flattened JSON: { CaseName : John Doe v. State, CaseDate :
I have Fortran-based 3D column-major order array flattened into linear memory. What formula/algorithm can
I have a WCF service with a Flattened WSDL , and the consumer at
I have an Xml document: <?xml version=1.0 encoding=utf-8?> <Family xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema> <Person member=father id=0>
I have a flattened table that contains columns that represent groups that need to
I have an Excel (or CSV) file that contains the following flattened columns: ID,XPath,Required?,BaseType,Restrictions
I have a SQL Server table AccountAction which is denormalised. It is a flattened
I have com.company.database.mysql and com.company.database.sqlite. I only want to include com.company.database.mysql. My code was
I have a list of numbers that represent the flattened output of a matrix

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.