What tags do I use for adding copyright notices to xml files?
Asked Answered
G

1

5

I am developing an app for my customer. The content that we create in the strings.xml are proprietary to them and they want a copyright notice and their trademark notice inside the XML file.

I want to be able to list both my copyright, and my customer's copyright.
What is the practice for including such information into the xml? Do I create a tag called "copyright"?

Gandhi answered 20/5, 2012 at 5:30 Comment(2)
Are you delivering some form of media (copyrighted text, copyrighted code)? You could describe each entry in a format that is suited to its needs. I'll update my answer to explain.Nutritionist
It seems to me you are asking a question about business policy rather than a technical question. Since StackOverflow is hassling me to vote on questions, I'm therefore going to downvote it. Sorry!Peggypegma
N
11

XML are not meant to be viewed by the public, but by developers or tools.

Carrying author information is either part of the data (as in blog articles having an author) or it doesn't.

You can however use XML comments for that. Or you can define your own XSD and structure everything like this:

<?xml?>
<!--
    Copyright notices here
    From you regarding the XML itself
    From your client regarding the XML contents
-->
<root xmlns:copyright="http://www.w3.org/1999/xhtml">
    <!-- per file meta-data here -->
    <metadata>
        <!-- authors make it -->
        <author name="XXXXX" />
        <!-- copyright holders buy it from authors and sell it -->
        <copyright name="XXXXX" />
        <license type="GPL">
            Lorem ipsum dolor sit amet...
        </license>
    </metadata>
    <data>
        <entry>
            <!-- per entry meta-data here -->
            <metadata>
                <author name="XXXXX" />
            </metadata>
            <contents>
            </contents>
        </entry>
    </data>
</root>

Also if it is needed by third party applications (to be extracted and shown) it would be more useful if you used XML elements not comments, as they are easy to manipulate.

I mean it's ok to have a comment with a simple text but if you want to put complex info there like I showed in my example, with sub-fields like author/copyright/license, it is easy for third party programmers to get those Node objects.

As a variation if you're feeling particularly namespacey:

<?xml?>
<!--
    Copyright notices here
    From you regarding the XML itself
    From your client regarding the XML contents
-->
<root xmlns:copyright="http://www.w3.org/1999/xhtml">
    <!-- per file meta-data here -->
    <copyright:info>
        <!-- authors make it -->
        <copyright:author name="XXXXX" />
        <!-- copyright holders buy it from authors and sell it -->
        <copyright:holder name="XXXXX" />
        <copyright:license type="GPL">
            Lorem ipsum dolor sit amet...
        </copyright:license>
    </copyright:info>
    <data>
        <entry copyright:author="author name" copyright:holder="holder name">
            <contents>
            </contents>
        </entry>
    </data>
</root>

With namespaces the third party programmers will have an easy time separating the two layers of information.

Nutritionist answered 20/5, 2012 at 5:32 Comment(5)
We do put our copyright information or whether our codes are GPL, etc into our codes. So i am wondering if it should be the same for XML files. it is the xml that contains the proprietary information of my customers, not the codes.Gandhi
Why not comment it? Comments in xml are run-time nodes, they are not discarded. So all the information in the comments is accessible to third party applications that would need them.Nutritionist
i see. i didn't know that the comments are not discarded. that will be a better idea than <string name="trademarkNotice1">"xxx","yyy","zzz" and the AAA logo are registered trademarks of abc Pte Ltd.</string> <string name="copyrightNotice1"> ©2012 abc Pte Ltd. All rights reserved</string>. thanks.Gandhi
With all the freedom of XML why would you name the copyright notice <string>? Why not <copyright> or as per my example <metadata><author /></metadata>Nutritionist
how do you make the copyright symbol the circled 'C' in the xml file?Flanker

© 2022 - 2024 — McMap. All rights reserved.