* xmlSchemaGetType: * @schema: the main schema * @name: the type's name * nsName: the type's namespace * * Lookup a type in the schemas or the predefined types * * Returns the group definition or NULL if not found. */
| 4778 | * Returns the group definition or NULL if not found. |
| 4779 | */ |
| 4780 | static xmlSchemaTypePtr |
| 4781 | xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name, |
| 4782 | const xmlChar * nsName) |
| 4783 | { |
| 4784 | xmlSchemaTypePtr ret = NULL; |
| 4785 | |
| 4786 | if (name == NULL) |
| 4787 | return (NULL); |
| 4788 | /* First try the built-in types. */ |
| 4789 | if ((nsName != NULL) && xmlStrEqual(nsName, xmlSchemaNs)) { |
| 4790 | ret = xmlSchemaGetPredefinedType(name, nsName); |
| 4791 | if (ret != NULL) |
| 4792 | goto exit; |
| 4793 | /* |
| 4794 | * Note that we try the parsed schemas as well here |
| 4795 | * since one might have parsed the S4S, which contain more |
| 4796 | * than the built-in types. |
| 4797 | * TODO: Can we optimize this? |
| 4798 | */ |
| 4799 | } |
| 4800 | if (schema != NULL) { |
| 4801 | WXS_FIND_GLOBAL_ITEM(typeDecl) |
| 4802 | } |
| 4803 | exit: |
| 4804 | |
| 4805 | return (ret); |
| 4806 | } |
| 4807 | |
| 4808 | /** |
| 4809 | * xmlSchemaGetAttributeDecl: |
no test coverage detected