Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDataXMLDocument class (definded in GDataXMLNode.h header file) does not contain support for inserting standalone attribute in processing directives and setting declarative statements or DOCTYPE #98

Open
GoogleCodeExporter opened this issue Apr 6, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What is the expected output? What do you see instead?
It should insert a standalone attribute in processing directives and insert a 
declarative statements node in GDataXMLDocument with the specified name given. 
No such method exist to provide this functionality.

We would like to add a new method in GDataXMLDocument class which will take a 
single boolean argument and adds standalone attribute in document according to 
the value of passed in argument and add another new method in GDataXMLDocument 
class which will take a single string argument and adds a DTD node in document 
with the name passed in argument.
We have implemented this method like this.

These methods are declared in GDataXMLDocument class defined in GDataXMLNode.h 
header file

- (void)setStandalone:(BOOL)value;
- (void)setDTDWithName:(NSString *)name;

Their implementation is in GDataXMLNode.m implementation file inside 
GDataXMLDocument implementation

- (void)setStandalone:(BOOL)value {

    if (xmlDoc_ != NULL) {

        if (value) { //if yes i.e document is standalone

            xmlDoc_->standalone = 1;
        }
        else {

            xmlDoc_->standalone = 0;
        }
    }
}

- (void)setDTDWithName:(NSString *)name {

    if (xmlDoc_ != NULL) {

        if (xmlDoc_->intSubset != NULL) {

            xmlFreeDtd(xmlDoc_->intSubset);
            xmlDoc_->intSubset = NULL;
        }
        if (name != nil) {

            xmlDtdPtr newDtd = xmlCreateIntSubset(xmlDoc_, 
                                                  GDataGetXMLString(name),
                                                  NULL, 
                                                  NULL);
            xmlDoc_->intSubset = newDtd;
        }
    }
}
Find the attached updated header and implementation files.
The CLA from our organization is also attached.

Khurram Shehzad
Skylight Software, Inc.
Telephone: 011-92-343-522-0225
E-Mail: [email protected]

Original issue reported on code.google.com by [email protected] on 10 Jun 2011 at 10:31

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant