5

In xml i can include a file in a another xml file and use it. This is usefull if your software get the configuration file from xml but doesn't have any method to separate configuration like apache/ngnix(nginx.conf - site-available/ - site-enable/).

file A:

<!DOCTYPE icecast [
  <!ENTITY mount SYSTEM "mount.xml">
]>

<icecast>
    ...
    &mount;
    ...
</icecast>

file B:

<mount>
    <mount-name>/xyz</mount-name>
    <username>source</username>
    <password>password</password>
    <max-listeners>30</max-listeners>
    <hidden>0</hidden>
    <public>1</public>
    <no-yp>0</no-yp>
</mount>

But what if the configuration file is in json format? Is there a method equivalent?

I need to have a better organization of my couchbase-sync bucket configuration.

jedi
  • 839
  • 12
  • 33

1 Answers1

8

There is no mechanism in JSON for including another file, like you describe. JSON is not a language in the sense that XML is, it's just the JavaScript object notation, so it only serves to describe application objects, nothing else.

David Ostrovsky
  • 2,461
  • 12
  • 13