<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/XMLNode/Options/nodeLoadExternalEntitiesSameOriginOnly",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSXMLNodeOptions@NSXMLNodeLoadExternalEntitiesSameOriginOnly"
  },
  "title" : "nodeLoadExternalEntitiesSameOriginOnly"
}
-->

# nodeLoadExternalEntitiesSameOriginOnly

Requests that external entities are always loaded and only applies when a URL has been provided.

```
static var nodeLoadExternalEntitiesSameOriginOnly: XMLNode.Options { get }
```

## Discussion

It loads entities with target URLs that match the host, scheme, and port of the document URL.You may choose  only one of [`nodeLoadExternalEntitiesAlways`](/documentation/Foundation/XMLNode/Options/nodeLoadExternalEntitiesAlways), [`nodeLoadExternalEntitiesSameOriginOnly`](/documentation/Foundation/XMLNode/Options/nodeLoadExternalEntitiesSameOriginOnly), or [`nodeLoadExternalEntitiesNever`](/documentation/Foundation/XMLNode/Options/nodeLoadExternalEntitiesNever) or none.

Choosing none results in the system-default behavior. For applications linked on OS X v10.6 and earlier, this is `NSXMLNodeLoadExternalEntitiesAlways`. For applications linked on macOS 10.7 or later, all entities that don’t require network access are loaded.

If an external entity fails to load, the document is invalid and the parse is aborted with an error.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)