[mlview-list][patch] dtd on commandline bugzilla 131372



The DTD specified with the -d or --dtd commandline option is associated
with the xml file(s) given on the commandline. Patch attached.

Can be found in Bugzilla as #131372.
Index: mlview/ChangeLog
===================================================================
RCS file: /cvs/gnome/mlview/ChangeLog,v
retrieving revision 1.217
diff -r1.217 ChangeLog
0a1,10
> 2004-01-31  Luuk de Waard <luuk myjaring net>
> 	* src/main.c:
> 	* src/mlview-editor.h, src/mlview-xml-document.h:
> 	* src/mlview-editor.c, src/mlview-xml-document.c:
> 	Added --dtd/-d commandline option
> 	Changed mlview_xml_document_open, mlview_editor_load_xml_file
> 	Added mlview_xml_document_open_with_dtd
> 	Added mlview_editor_load_xml_file_with_dtd
> 	Bugzilla: 131372
> 	
Index: mlview/src/main.c
===================================================================
RCS file: /cvs/gnome/mlview/src/main.c,v
retrieving revision 1.21
diff -r1.21 main.c
52a53,54
>         gchar* associated_dtd = NULL;
> 
71a74,82
>                 {
>                  "dtd",
>                  'd',
>                  POPT_ARG_STRING,
>                  &associated_dtd,
>                  0,
>                  N_
>                  ("Associates DTD with the XML documents on the commandline"),
>                  NULL},
104a116,121
> 
>         if (associated_dtd != NULL)
>         {
>                 g_print ("DTD: %s\n", associated_dtd);
>         }
> 
120c137
<                                 mlview_editor_load_xml_file
---
>                                 mlview_editor_load_xml_file_with_dtd
122c139,140
<                                          (gchar *) args[i]);
---
>                                          (gchar *) args[i],
>                                          associated_dtd);
Index: mlview/src/mlview-editor.c
===================================================================
RCS file: /cvs/gnome/mlview/src/mlview-editor.c,v
retrieving revision 1.72
diff -r1.72 mlview-editor.c
885d884
< 
896a896,912
>         mlview_editor_load_xml_file_with_dtd(a_this, a_file_path, NULL);
> }
> 
> /**
>  *Opens the xml file a_file_path, loads it, build a view to edit it and
>  *adds this new view to the editor.
>  *The file is validated with the DTD if provided.
>  *
>  * param a_this the current instance of #MlViewEditor.
>  * param a_file_path the path of the file to open.
>  * param a_dtd_path the path of the dtd to validate against.
>  */
> void
> mlview_editor_load_xml_file_with_dtd (MlViewEditor * a_this,
>                              gchar * a_file_path,
>                              gchar * a_dtd_path)
> {
914c930,931
<                 mlview_xml_document_open (a_file_path,
---
>                 mlview_xml_document_open_with_dtd (a_file_path,
>                                                    a_dtd_path,
Index: mlview/src/mlview-editor.h
===================================================================
RCS file: /cvs/gnome/mlview/src/mlview-editor.h,v
retrieving revision 1.32
diff -r1.32 mlview-editor.h
121a122,125
> void mlview_editor_load_xml_file_with_dtd (MlViewEditor * a_this,
>                                            gchar * a_file_path,
>                                            gchar * a_dtd_path);
> 
Index: mlview/src/mlview-xml-document.c
===================================================================
RCS file: /cvs/gnome/mlview/src/mlview-xml-document.c,v
retrieving revision 1.73
diff -r1.73 mlview-xml-document.c
1006a1007,1025
>         return mlview_xml_document_open_with_dtd (a_file_name, NULL, a_context);
> }
> 
> /**
>  *Opens and loads the xml file contains in the filename given in parameter. 
>  *
>  * param a_file_name the total file path of the file that contains 
>  *the xml document to open
>  * param a_dtd_name the total file path of the file that contains
>  *the dtd to validate against
>  * param a_context the mlview application context.
>  *the current instance of MlViewXMLDocument.
>  * return the newly loaded xml document.
>  */
> MlViewXMLDocument *
> mlview_xml_document_open_with_dtd (gchar * a_file_name,
>                           gchar * a_dtd_name,
>                           MlViewAppContext * a_context)
> {
1007a1027
>         MlViewExtSubsDef *external_subset_def = NULL;
1016a1037
> 
1017a1039,1045
> 
>         if (a_dtd_name != NULL) {
>                 external_subset_def = mlview_ext_subs_def_new(NULL, NULL, a_dtd_name);
>                 if (external_subset_def) {
>                         mlview_xml_document_associate_dtd (result, external_subset_def);
>                 }
>         }
Index: mlview/src/mlview-xml-document.h
===================================================================
RCS file: /cvs/gnome/mlview/src/mlview-xml-document.h,v
retrieving revision 1.45
diff -r1.45 mlview-xml-document.h
212a213,216
> MlViewXMLDocument *mlview_xml_document_open_with_dtd (gchar * a_file_name,
>                                                       gchar * a_dtd_name,
>                                                       MlViewAppContext * a_context);
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]