- String textContent = xmlElement.getTextContent();
-
- Preconditions.checkNotNull(textContent, "This element should contain text %s", xmlElement);
+ String textContent = "";
+ try{
+ textContent = readElementContent(xmlElement);
+ }catch(IllegalStateException | NullPointerException e) {
+ // yuma sends <attribute /> for empty value instead of <attribute></attribute>
+ logger.warn("Ignoring exception caused by failure to read text element", e);
+ }
+
+ if (null == textContent){
+ throw new NetconfDocumentedException(String.format("This element should contain text %s", xmlElement),
+ NetconfDocumentedException.ErrorType.application,
+ NetconfDocumentedException.ErrorTag.invalid_value,
+ NetconfDocumentedException.ErrorSeverity.error);
+ }