tianshanxuester / gdata-objectivec-client

Automatically exported from code.google.com/p/gdata-objectivec-client
Other
0 stars 0 forks source link

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 9 years ago

GoogleCodeExporter commented 9 years ago
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: khurram@storagetree.com

Original issue reported on code.google.com by khurram....@gmail.com on 10 Jun 2011 at 10:31

Attachments: