* xmlNewEntityInputStream: * @ctxt: an XML parser context * @ent: an Entity pointer * * DEPRECATED: Internal function, do not use. * * Create a new input stream based on an xmlEntityPtr * * Returns the new input stream or NULL */
| 1861 | * Returns the new input stream or NULL |
| 1862 | */ |
| 1863 | xmlParserInputPtr |
| 1864 | xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) { |
| 1865 | xmlParserInputPtr input; |
| 1866 | |
| 1867 | if ((ctxt == NULL) || (ent == NULL)) |
| 1868 | return(NULL); |
| 1869 | |
| 1870 | if (ent->content != NULL) { |
| 1871 | input = xmlNewInputString(ctxt, NULL, (const char *) ent->content, |
| 1872 | NULL, XML_INPUT_BUF_STATIC); |
| 1873 | } else if (ent->URI != NULL) { |
| 1874 | input = xmlLoadExternalEntity((char *) ent->URI, |
| 1875 | (char *) ent->ExternalID, ctxt); |
| 1876 | } else { |
| 1877 | return(NULL); |
| 1878 | } |
| 1879 | |
| 1880 | if (input == NULL) |
| 1881 | return(NULL); |
| 1882 | |
| 1883 | input->entity = ent; |
| 1884 | |
| 1885 | return(input); |
| 1886 | } |
| 1887 | |
| 1888 | /** |
| 1889 | * xmlNewStringInputStream: |
no test coverage detected