1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

XML Schemas (autocompletion for XML)

Discussion in 'Tools' started by Piranha, Feb 18, 2017.

  1. Piranha

    Piranha Member

    Messages:
    13
    Likes Received:
    4
    Joined:
    Feb 10, 2017
    XML Schemas
    available under https://github.com/Pyrax/gtan-xsd

    These XML Schema Definitions (called XSD) can be used to get autocompletion and simple validation in Visual Studio for writing XML files. This currently includes schemas for resources (ACL & Meta) and for server's settings.

    Usage is of course not limited to Visual Studio, though in other IDEs you might not get any benefits like autocompletion.

    [​IMG] [​IMG]

    General usage
    It's as simple as including the following snippet in the root element of your XML:
    Code:
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://gtan.azurewebsites.net/schema/resource"
    xsi:schemaLocation="http://gtan.azurewebsites.net/schema/resource
                        http://gtan.azurewebsites.net/schema/resource/meta.xsd"
    This snippet is only for Meta-XMLs. For the other type of XML files you need to replace the paths. You can find a list of these files, examples and further instructions on GitHub.

    Additional notes on Visual Studio
    By default, Visual Studio disabled the automatic download of schema files. You can either active it in the settings or you can manually download the files and replace the second url in "schemaLocation" with the local path of the downloaded schema file.
    The setting can be found under "Tools > Options > Text Editor > XML":
    [​IMG]
    Then tooltips and autocomplete should appear. If not, try to hold STRG and click on the link ending with .xsd. This should trigger a manual download of the schema.

    Download
    If you need the files, they can be retrieved from GitHub: https://github.com/Pyrax/gtan-xsd
    Otherwise they can simply be referenced the former way under "general usage".

    Feel free to leave a comment and let me know if this resource helps you.
     
    Last edited: Feb 23, 2017
    MissMelissa likes this.
  2. MissMelissa

    MissMelissa New Member

    Messages:
    0
    Likes Received:
    0
    Joined:
    Dec 26, 2016
    Very nice!
     
  3. DurtyFree

    DurtyFree New Member

    Messages:
    0
    Likes Received:
    0
    Joined:
    Oct 30, 2016
    This indeed will make my life easier :=D
     
  4. Piranha

    Piranha Member

    Messages:
    13
    Likes Received:
    4
    Joined:
    Feb 10, 2017
    Just added support for .map XML-files!
    Also provided two examples on GitHub and some documentation files if somebody is interested in it.
     

Share This Page